Re: Help Me Understand PHP5, register_globals=off, $HTTP_POST_VARS, and $_POST

From: Date: Wed, 13 Oct 2004 10:50:56 +0000
Subject: Re: Help Me Understand PHP5, register_globals=off, $HTTP_POST_VARS, and $_POST
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199352@lists.php.net to get a copy of this message
Francis Chang wrote:
Hello, I've done some homework on my own by reading through PHP documentation and various articles; however, I am still a bit confused as to what is supported in PHP 5.0 when register_globals is set to off. In PHP5.0, if the register_globals parameter is set to off (as it is by default), I know that we're supposed to use the $_POST super globals to access the post variables. My question is, is the $HTTP_POST_VARS global still populated for backwards compatibility? In other words, if I have an old script that has the following piece of code running on a PHP5.0 environment with register_globals off (after submission of a form), would it still work as expected? Function someFunction($variable) { global $HTTP_POST_VARS; return IsSet($HTTP_POST_VARS[$variable]) } Thanks in advance for your help.
The old style array still exists. In PHP 5 there is a setting in php.ini that allows you to shut off the long arrays. At this point, it is on by default. At some point, it might become off by default. It's extra work for PHP to create them if you aren't going to use them. Janet -- Janet Valade -- janet.valade.com

« previous php.general (#199352) next »