Re: Quotes in GET variables

From: Date: Mon, 21 May 2001 12:05:43 +0000
Subject: Re: Quotes in GET variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53701@lists.php.net to get a copy of this message
It's a feature of PHP that it automatically escapes data submitted in PUT/GET/etc. It's nice in that it adds to how secure PHP code is, but it can be a hassle. Not sure if there is a function which removes escape characters will leaving normal backslashes alone. If you REALLY need to turn it off I believe it's the magic_quotes_gpc option. Plutarck ""Mark Rogers"" <mark-news@quarella.co.uk> wrote in message news:9eavif$dks$1@toye.p.sourceforge.net... > If I submit a string to a script via GET which contains quotes, how should > they appear in my script? > > Eg: > --- test.php --- > echo $HTTP_GET_VARS['test']; > > Go to: > test.php?test=this+doesn%27t+work > > .. and you get: > this doesn\'t work > > (Char 27 is a single quote. Echoing $test gives the same result.) > > I can use stripslashes lose the escape char, but should this be necessary? > I'm using v4.0.4pl1 > > -- > Mark Rogers > Lose the -news in the email address if replying direct > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#53701) next »