Forum Moderators: coopster
fsseditor.Value = '$text[body]';
So in order to prevent javascript errors I have to do multiple str_replace's, like below:
$_POST['body'] = str_replace("\r\n",'',$_POST['body']);
$_POST['body'] = str_replace("'","\'",$_POST['body']);
It's removing all of the \r\n but its not even touching the single quotes.
Is there any other way I can accomplish the same effect?
Any help is greatly appreciated. Thank you!
the str_replace for quotes could probably just be replaced with add_slashes though depending on where it is going after you may want use mysql_escape_string.
Are you just chopping \r\n? str_replace is fine for that but there may be alternatives if there are other things that need to go as well. You could also look at the settings on the input method, I think textareas can be set to not send newlines.