Page 1 of 1

Quotes in form variables

Posted: Thu Jul 24, 2003 4:05 am
by EricGen
Hi,

Everytime there is a quote in a form parameter, the variable I get, whether passed as post or get, has the quote preceeded by a \

This is a pain as then it is written as such in the database. Is there something I should do to ensure the variables I get are exactly what the user typed? If the form is resubmitted I end up with tons of \

Thanks

Posted: Thu Jul 24, 2003 4:45 am
by Fredix
probably stripsplashes will help you
string stripslashes ( string str)

Returns a string with backslashes stripped off. ('' becomes ' and so on.) Double backslashes are made into a single backslash.
--quote from php.net

Posted: Thu Jul 24, 2003 4:51 am
by EricGen
yes thanks. For now I was using str_replace which of course doesn't help if the user does enter some \