[PHP] Re: How to set register_globals=off in the script?
Jerry Swanson 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? You can change this, and other php.ini directives, with the PHP function ini_set -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to set register_globals=off in the script?
From: Jason Barnett [EMAIL PROTECTED] Jerry Swanson wrote: I have PHP 5.1, is it possible in the code set register_globals=off for specific scripts. You can change this, and other php.ini directives, with the PHP function ini_set No, you can't. register_globals cannot be set with ini_set and must be set in php.ini or an .htaccess file. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: How to set register_globals=off in the script?
Jason Barnett wrote: So I want to keep PHP register_globals=on in php.ini, but in local files set to off? How I can do this? You can change this, and other php.ini directives, with the PHP function ini_set register_globals cannot be changed with ini_set(). It is of type PHP_INI_PERDIR meaning that it can only be changed in the php.ini, .htaccess, or httpd.conf. See: http://www.php.net/manual/en/function.ini-set.php Personally I prefer to set register_globals=off in php.ini, then use an .htaccess file to turn it on only for those applications that absolutely require it to function. That way new applications default to register_globals=off. IOW, I prefer to have to take specific action to open up potential security holes rather than having to take specific action to close them. YMMV... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to set register_globals=off in the script?
On Wednesday 22 December 2004 05:08, Jason Barnett wrote: Jerry Swanson wrote: So I want to keep PHP register_globals=on in php.ini, but in local files set to off? How I can do this? You can change this, and other php.ini directives, with the PHP function ini_set No you can't. Well you can change it but it'll have no effect. Read manual on ini_set() to see what can be changed and *where* it can be changed. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The only difference in the game of love over the last few thousand years is that they've changed trumps from clubs to diamonds. -- The Indianapolis Star */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php