Re: register_globals toggle within a script?
| From: | Zeev Suraski | Date: | Fri, 17 Nov 2000 21:58:32 +0000 |
| Subject: | Re: register_globals toggle within a script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25966@lists.php.net to get a copy of this message | ||
At 15:16 16/11/2000, Dan Lowe wrote:
I am in a situation where register_globals is turned on for my site in /usr/local/lib/php3.ini, but I need to turn it off for a particular script I am working on. Turning it off site-wide would break most of our other scripts, so that is not an option. Can register_globals be turned off within a script itself? I can't seem to find anything related to something like this in the documentation or the list archives.No, there's no way of doing it, because PHP pays attention to the value of register_globals before the script actually begins to run. If the INI path you typed up is not a typo, and you're using PHP 3.0, then there's no way at all to turn register_globals off. If you are using PHP 4.0 as an Apache module, though, you can turn register_globals off on a per-directory basis, using .htaccess. It would look something like: php_flag register_globals 0 Note, however, that it will affect that entire directory and its subdirectories. Zeev -- Zeev Suraski <zeev@zend.com> CTO, Zend Technologies Ltd. http://www.zend.com/