I can upload to MySQL fine, no problems. When I try to bring the content back into a php page that has more that 1 line to edit, the editor does not show up and I get the javascript error:
Line:114
Char: 37
Error: Expected ';'
Code: 0
URL: http://some_url/
<!-- START CODE
<?php
function prepTextForEditor($in)
{
$out = str_replace(chr(10), "", $in);
$out = str_replace(chr(13), "", $out);
return str_replace("'", "\'", $out);
}
$strTEXT = $row["content"];
?>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.Width = 600 ; // 400 pixels
oFCKeditor.Width = "100%" ; // 250 pixels
oFCKeditor.Value = " <?php echo prepTextForEditor($strTEXT);?> " ;
oFCKeditor.Create() ;
</script>
END CODE -->
I think it is because the Value=""; doesnt concatenate properly with a '+' sign. How do I fix this???
RE: oFCKeditor.Value Error
$strTEXT = addslashes($row["content"]);
?>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.Width = 600 ; // 400 pixels
oFCKeditor.Width = "100%" ; // 250 pixels
oFCKeditor.Value = " <?=$strTEXT;?> " ;
oFCKeditor.Create() ;
</script>
END CODE -->
RE: oFCKeditor.Value Error
RE: oFCKeditor.Value Error
<!-- START CODE
function prepareForEditor($s) {
$a = explode("\n",$s);
for ($i=0;$i<count($a);$i++) {
$a[$i] = "\"".addslashes($a[$i]);
if (($i+1) < count($a)) $a[$i] .= "\"+";
else $a[$i] .= "\";";
}
return implode("\n",$a);
}
$strTEXT = prepareForEditor($row["content"]);
?>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.Width = 600 ; // 400 pixels
oFCKeditor.Width = "100%" ; // 250 pixels
oFCKeditor.Value = <?=$strTEXT;?>
oFCKeditor.Create() ;
</script>
END CODE -->
RE: oFCKeditor.Value Error
Or replace '+' with +
RE: oFCKeditor.Value Error
I was wondering the exact same thing, but there must be some reason he's doing it, that's why I tried to provide a solution instead of make him use another technology