Re: magic quotes
| From: | Foong | Date: | Thu, 03 Apr 2003 08:01:09 +0000 |
| Subject: | Re: magic quotes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142088@lists.php.net to get a copy of this message | ||
Hello,
When magic_quotes_gpc is on, addslashes() will be automatically applied on
all data from GET, POST, COOKIES by PHP.
When magic_quotes_runtime is on, addslashes() will be automatically applied
on all data collected form database (ex: when you execute a SELECT
statement). Therefore when magic_quotes_runtime is on, you need to use
stripslashes() on data colected from database. It is not only apply to data
collected from database, others as well. I believe there is a details guide
in the php documentation at php.net.
Foong
"Justin French" <justin@indent.com.au> wrote in message
news:BAB220E1.23F4B%justin@indent.com.au...
> Hi all,
>
> Can I just have a quick head check on magic quotes runtime (&gpc)?
>
> I have them both set to Off currently, and my pages work fine. However,
> when I set them to on, I end up with slashes throughout the mysql data.
>
> Is this the expected behaviour? Seems counter-intuitive to me, but I've
> never really cared about it 'till today, because i've never had a
problem!!
>
>
> What is a common setting for these two directives, so that I can have my
LAN
> server *reasonably* "normal".
>
> TIA
> Justin
>