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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
irvingcohen
Forum Newbie
Posts: 1
Joined: Tue May 27, 2003 9:27 am
Location: St. Paul

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

Post 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.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

stripslashes will do.
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Post 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
Sinnix
Forum Commoner
Posts: 43
Joined: Mon Apr 28, 2003 11:01 am
Location: Ottawa, ON Canada
Contact:

Post by Sinnix »

You *could* be wrong... but you're right! ;)
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post 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".
Post Reply