Page 1 of 1

how to get rid of "\" before "'"

Posted: Tue May 27, 2003 9:27 am
by irvingcohen
In a website that I built I am having a problem with visitor text submissions. For some reason PHP is outputting a "\" character before every aposthrophe character that is in the submission. Go to http://x.mcad.edu:16080/~aaron/animatio ... Design.php for a look at what I'm talking about.

Posted: Tue May 27, 2003 9:35 am
by []InTeR[]
stripslashes will do.

Posted: Tue May 27, 2003 10:39 am
by Zoram
I believe that php does that so that you can use the direct $_POST information to store it in a database etc without having to manually add all the \ to the text before storing. I could be wrong though

Posted: Tue May 27, 2003 11:09 am
by Sinnix
You *could* be wrong... but you're right! ;)

Posted: Tue May 27, 2003 1:19 pm
by liljester
if you dont like getting the quotes in your GET, POST, and COOKIE data, there are some configuration settings in php.ini (for windows, andyway) where you can turn them off. they are in the "Magic Quotes" section of the config file. all you have to do is set them to "Off".