Re: Post
| From: | Philip Olson | Date: | Thu, 20 Jun 2002 16:55:15 +0000 |
| Subject: | Re: Post | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103167@lists.php.net to get a copy of this message | ||
See these PHP directives:
Directive: Default:
------------------------------
magic_quotes_gpc on
magic_quotes_sybase off
If both are enabled, PHP will do what you want.
magic_quotes_gpc is the PHP directive that essentially
runs addslashes() on all your GetPostCookie data
automatically, which is what you're experiencing. This
cannot be set at runtime with ini_set().
magic_quotes_sybase is a little different, if on then
both magic_quotes_gpc and addslashes will escape as
'' not \'. magic_quotes_sybase can be set at runtime
with ini_set() which will affect your use of addslashes().
Regards,
Philip Olson
On Thu, 20 Jun 2002, Erik Price wrote:
>
> On Thursday, June 20, 2002, at 12:19 PM, James Drabb wrote:
>
> >
> > I was wondering if there is a setting to make PHP not change the posted
> > data? For
> > example I am posting a first and Last name and if I put in O'Hara for
> > the last name
> > PHP returns O\'Hara. I would prefer getting just O'Hara back and then
> > replacing
> > the ' with '' myself. I need to be able to put the posted data into
> > MySQL and MS SQL.
> > MS SQL doesn't like the O\'Hara format.
>
> Investigate the gpc_magic_quotes setting in the manual. It's set in
> your php.ini. You can either work around it using stripslashes() on
> your GET/POST/COOKIE data, or you can change the setting in php.ini or
> with a function that changes the setting like ini_set().
>
>
> Erik
>
>
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee@hhbrown.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>