Click to See Complete Forum and Search --> : textarea submit, then remove the \' or \"


Justin
10-11-2005, 08:58 AM
I have a textarea that when they sumbit the data, i want it to go into a file exactly how they entered the data into the textarea, currently it works fine, except it adds \' infront of ' and \" infront of "

$inputtext = $_POST['bodyofpage'];
$webphpfile = fopen ( "$location","w" );
flock ( $webphpfile, LOCK_EX);
fwrite ($webphpfile, $inputtext);
flock ( $webphpfile, LOCK_UN);
fclose ($webphpfile);


and the form i used


echo "<tr><td colspan=\"2\" align=\"center\"><textarea cols=70 rows=20 name=\"bodyofpage\">";
echo file_get_contents ( "$location" );
echo "</textarea></td></tr>";

SpectreReturns
10-11-2005, 10:04 AM
Change magic_quotes in php.ini or use strip_slashes().

Justin
10-11-2005, 08:12 PM
Thanks!