Re: How to set register_globals=off in the script?

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

 



Yes and no...
Here's what the manual has to say about this...Basically, you can't do
it using ini_set, but you can do it using an htaccess file.

http://us2.php.net/manual/en/ini.sect.data-handling.php#ini.register-globals

register_globals  boolean

    Whether or not to register the EGPCS (Environment, GET, POST,
Cookie, Server) variables as global variables.

    As of PHP 4.2.0, this directive defaults to off.

    Please read the security chapter on Using register_globals for
related information.

    Please note that register_globals cannot be set at runtime
(ini_set()). Although, you can use .htaccess if your host allows it as
described above. An example .htaccess entry: php_flag register_globals
off.

        Note: register_globals is affected by the variables_order directive. 

On Tue, 21 Dec 2004 14:56:03 -0500, Jerry Swanson <pmysql@xxxxxxxxx> wrote:
> I know that "register_globals = on" is not secure. But one program
> requires to use register_globals=on. So in php.ini register_globals is
> set to on.
> 
> I have PHP 5.1, is it possible in the code set register_globals=off
> for specific scripts.
> 
> So I want to keep PHP register_globals=on in php.ini, but in local
> files set to off?
> 
> How I can do this?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
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