This has been discussed at length for EZpages but not for general usage.
I want to enter some PHP into a product listing. I can get around the issue, but I'd love to be able to do it My site uses the Zen Cart catalogue and product_book features. it contains almost 800 listings (or products to eCommerce users) and it seems to be working fine. I want to insert a newsletter registration form that requires nothing more than an email address to register, so I'll be using a program called Pomo which requires PHP to update a database.
This link will take you to the listing in question: http://trainzresources.com/directory...roducts_id=812
I've read a lot about adding PHP into a FckEditor listing, but I can't get it to work.
I've uncommented this line in fckconfig.js, the PHP code is no longer truncated but it still doesn't work. FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
I've tried entering some simple test code: <?php echo "TEST"; ?> When I save the listing and go to the online catalogue, the word TEST does not appear.
I've heard a couple of things:
You can't add PHP to a product listing. But it doesn't work in Categories listings either.
Others outside Zen Cart have experienced the same problem with the FCKConfig change, whilst others have said it works.
One guy who said it didn't work also said that he had found a solution. This is what he said:
"Solved! Ahh! The joys of API!"
Code:
function InsertHTML(){
var oEditor = FCKeditorAPI.GetInstance('content') ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ){
oEditor.InsertHtml('WHAT YOU WANT? WHERE YOU WANT IT?') ;
}else alert('You must be on WYSIWYG mode!');}
//How to use it;
<input type="button" value="InsertHTML" onclick="InsertHTML();" />
Comment:
"I see that FCKeditor's API demo isn't there, it's all CK... something. (you could've seen it on their site)"
------------------------
All that is mumbo jumbo to me. Has anyone here actually been successfull in adding PHP? If so what is the trick?



