Hoi!
I have a big problem.
I write an administrator page, and i like to use fckeditor.
I write a <div style="text-align: justify;"></div> in the editor, and i use the php addslashes() function to fill in mysql database...this ok ( this is the mysql database content <div style=\"text-align: justify;\"></div>) not this is the problem...when i see this text in a html page i use the stripslashes() function and its working...but when i like to editing the text in the fckeditor, the editor is unable to visible...what do i do ?
I have a big problem.
I write an administrator page, and i like to use fckeditor.
I write a <div style="text-align: justify;"></div> in the editor, and i use the php addslashes() function to fill in mysql database...this ok ( this is the mysql database content <div style=\"text-align: justify;\"></div>) not this is the problem...when i see this text in a html page i use the stripslashes() function and its working...but when i like to editing the text in the fckeditor, the editor is unable to visible...what do i do ?

RE: php+mysql+fckeditor
RE: php+mysql+fckeditor
RE: php+mysql+fckeditor
RE: php+mysql+fckeditor
I've had this problem before.
I simply stripslashes() when selecting on the edit page.
IE You stripslashes() for the display page. Also use this methodology for the edit page.
Cheers
Richard
RE: php+mysql+fckeditor
RE: php+mysql+fckeditor
RE: php+mysql+fckeditor
=============
<TABLE width=80% border=0 cellpadding=2>
<FORM method=POST enctype='multipart/form-data'>
<INPUT type=hidden name=mode value="update">
<INPUT type=hidden name=header_content_id value="<? echo $row["header_content_id"]; ?>"><TR>
<TD bgcolor=DDDDDD><b>Content Name : </b></TD>
<TD bgcolor=EEEEEE><INPUT type=text size=24 name=header_content_name value="<? echo $row["header_content_name"]; ?>"></TD></TR>
<TR>
<TD bgcolor=DDDDDD valign=top><b>Content : </b></TD>
<TD bgcolor=EEEEEE>
<?php function prepTextForEditor($in) { $out = str_replace(chr(10), "", $in); $out = str_replace(chr(13), "", $out); return str_replace("'", "\'", $out); } $strTEXT = $row["header_content"]; ?><script type="text/javascript">
var oFCKeditor = new FCKeditor( 'header_content' ) ;
oFCKeditor.Height = 300 ; // 400 pixels
oFCKeditor.Width = "100%" ; // 250 pixels
oFCKeditor.Value = "<?php echo prepTextForEditor($strTEXT);?>" ;oFCKeditor.Create() ;
</script>
</TD>
</TR>
<TR>
<TD bgcolor=DDDDDD valign=top><b>Active : </b></TD>
<TD bgcolor=EEEEEE><INPUT type=checkbox name=header_content_active value="Y"<? if ($row["header_content_active"] == "Y") echo " checked"; ?>></TD></TR>
<TR>
<TD colspan=2><INPUT type=submit value="Update Content"> <INPUT type=button value="Cancel" onClick="self.location='header_content.php'"></TD>
</TR>
</FORM>
</TABLE>
=============
and still crashes, what am I missing????
RE: php+mysql+fckeditor
Because i was too lazy too add '\r\n' at the content i finaly called FCK whith the PHP-way.
Like this:
Good luck!
RE: php+mysql+fckeditor
function prepTextForEditor($in)
{
$out = str_replace(chr(10), "", $in);
$out = str_replace(chr(13), "", $out);
$out = str_replace(chr(34), "'", $out);
return str_replace("'", "\'", $out);
}
$strTEXT = $row["header_content"];
?>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'header_content' ) ;
oFCKeditor.Height = 300 ; // 400 pixels
oFCKeditor.Width = "100%" ; // 250 pixels
oFCKeditor.Value = "<?php echo prepTextForEditor($strTEXT);?>" ;oFCKeditor.Create() ;
</script>
$out = str_replace(chr(34), "'", $out); was the key
RE: php+mysql+fckeditor