Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String is autoquoting--how to unquote? 1

Status
Not open for further replies.

natwod

Programmer
Nov 21, 2002
41
US
Hi,

I have a guestbook and one of the fields (a textbox) allows all characters (the other fields only allow a-zA-Z through javascript), and when a special character is typed into the textbox (',",\) and I echo it using php, that character appears on the page quoted.

For instance, if I typed "can't" into the text box and submitted it, it would display as "can\'nt" on the page. Is this something that PHP is doing to the string? I have tried many different ways to try and get rid of the \ (there are many of them: ereg,preg,unquote,uncquote) using PHP, but everything I tried just returned an empty string.

Any idea what's going on? Thanks!!!

Natwod
 
magic_quotes_gpc boolean
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote), " (double quote), \ (backslash) and NUL's are escaped with a backslash automatically.

Note: If the magic_quotes_sybase directive is also ON it will completely override magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as ''. Double quotes, backslashes and NUL's will remain untouched and unescaped.

See also get_magic_quotes_gpc()


to correct this, visit your php.ini and turn em off :)


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top