|
Posted by NC on 01/25/06 20:48
Roddytoo wrote:
>
> (message)
> This is to let you know that as from 1 Feb 2006 the setting
> "register_globals" in php will be disabled.
Let's say you have a script that is called like this:
script.php?parameter=somevalue
With register_globals = On, PHP will automatically create a variable
called $parameter and assign a value "somevalue" to it. With
register_globals = Off, no such thing will take place; the parameter
will only be accessible as $_GET['parameter']. Similar things will
happen with parameters sent via POST method (they will only be
available as fields in the $_POST array).
The quick (and EXTREMELY dirty) fix for this is to add the following
line to the beginning of every problematic script:
extract($_REQUEST);
This will essentially do what PHP does automatically when
register_globals = On.
A better (and more labor-intensive) way to handle the situation is to
make sure the scripts are written assuming register_globals = Off.
They will still work even if register_globals = On, because the
superglobal variables ($_GET, $POST, etc.) remain accessible regardless
of the register_globals setting...
Cheers,
NC
Navigation:
[Reply to this message]
|