Re: Magic quotes question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ben Edwards wrote:
> In the php manual it states
>
> ' Keep in mind that the setting  magic_quotes_gpc will not work at
> runtime.'
>
> What douse this actualy mean?

Translation:
If you try to use ini_set to change magic_quotes_gps in your .php script,
here's what happens:

Step 1: Apache/PHP set up $_POST/$_GET/$_COOKIES based on php.ini setting
of magic_quotes_gpc
Step 2: Your script runs
Step 3: Your script calls ini_set('magic_quotes_gpc', ???);

As you can imagine, it really doesn't do much good at that point to change
this setting, since all the work of loading in POST/GET/COOKIES is already
done.

Now, if you worked hard, you could maybe find a way to change the setting,
and then you could re-parse the GET arguments and the POST data (assuming
you configured settings to provide raw POST data) and maybe even (somehow)
manage to re-interpret the cookies...

Or you could just live with the current setting and use stripslashes() or
addslashes() as needed to get the data in the form you want which would be
a zillion times easier.

So while you maybe *CAN* change magic_quotes_gpc at run-time with ini_set,
there ain't a whole lot of point to it, unless you've got a ton of data
you are re-parsing from somewhere else that relies on that setting.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux