php - using stripslashes() discriminately -


my php application uses stripslash () to deal with magic_quotes, but I only want the magic_quotes slash to be used. Remove, because the user is allowed to supply \ "with their input.

Strips lash does not remove the slash indiscriminately.

If the magic quote is on, it will be saved from slash, '\' will replace with '\\' , and strip slashes must be reversed by running magic quotes in the right way, to withdraw the user on which the entered '\\' should replace '\' .

I think you might want something like this:

Manual (http://us3.php.net/manual/en/function.get) -magic-quotes -gpc.php) if (get_magic_quotes_gpc ()) {$ lastname = stripslashes ($ _ POST [' Lastname ']);} and {$ lastname = $ _POST [' last name ']; }

At the end of the code, there should be no slash except the user $ last name .

On another note, magic quotes are a security problem, and have been demoted in new versions of PHP (see).


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -