Hi I'm getting values from a textarea in html and writing them with fputs. BUT if the user enters an ' or an " in the data, the ouput gets an \ inserted before them.
eg I'm "ok" becomes I\'m \"ok\"
Is there an easy way to stop this
TIA Leanne
Hi me again,
apologies !!!!
htmlspecialchars(stripslashes($ will do it many thanks
try this...
$message = str_replace("\", "", $message);
Or you can go to the source of the problem in your php.ini file. Set the magic_quotes_gpc to Off. PHP escapes quotes with backslashes if magic_quotes_gpc = On.
Take a look at http://www.php.net/manual/configuration.php#ini.magic-quotes-gpc for more information.