I have a php file that receives data from a form and then writes that information to a txt file. It works great except sometimes users use ” or ‘ when filling in the fields. When this happens the txt file of course has a \” or a \’ I want to get rid of the \ so I want to use the stripslash function. Here is some samples from the php code, I just dont know where and how to use stripslash:
$item=$_POST['item'];
or should it be used on this part?
$savestring = $carsearch . "\n" . $homesearch . "\n" . $next . "\n" . $item . "\n";
or maybe here:
fwrite($fp, $savestring);
I have left out most of the code on my php page to save space, but I just would really appreciate any help on where to use stripslash or if I should use another technique entirely. Thanks in advance
You have magic quotes turned on. Turn it off and the slashes will go away.