Hi all,
I am using the PHP4 implementation of FCKeditor version 2.6 Build 18638 with FireFox version 3.0.3 on a WAMP box. My configuration's FullPage attribute is set to true. Whenever I try to display contents of an PHP file in the WYSIWYG, it strips out the html xmlns attribute and random new line characters around the PHP code. This results in the page failing XHTML compliance and throwing a PHP fatal error.
Here's the contents of the PHP file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> <title>Welcome to my site!</title> </head> <body> <table cellspacing="0" cellpadding="0" border="0" align="center" style="width: 729px;"> <tbody> <tr> <td> <?php // see sample usage: admin > tools > widgets; require_once('lib/PageContent.class.php'); $wpage = new PageContent(); $wpages = $wpage->getActiveList(); if(count($wpages)>0){ ?> <div id="widgetContents">Widget code goes here</div> <?php } ?>##SHOPPING CART## </td> </tr> </tbody> </table> </body> </html>
Re: Editor strips out xmlns attribute and new lines
Hey all again,
I figured it out (sorta). The main problem was that my server side code was being stripped out (well actually random chunks of it were lost in translation. I'm not sure how the WYSIWYG decided what to throw out and what to keep, but it made a huge mess) when I first started working on the project and to avoid that I simply tricked the WYSIWYG by replacing all my <?php tags with <?php before sending the content to the editor: