[thelist] php: difference between post vars?

Simon Willison cs1spw at bath.ac.uk
Wed Aug 6 17:57:54 CDT 2003

Hi Anthony,

Wednesday, August 6, 2003, 9:10:01 PM, you wrote:
>>I'm wondering what the difference is between:
>>$HTTP_POST_VARS['submit'] and $_POST['submit]

> http://us3.php.net/variables.predefined

> $_POST

>      Variables provided to the script via HTTP POST. Analogous to the old 
> $HTTP_POST_VARS array (which is still available, but deprecated).

There's an additional different: $_POST (and $_GET and family) are
super-globals - they are available at all times, even inside
functions. $HTTP_POST_VARS (which is deprecated and should not be
used) was a normal global variable, meaning you had to explicitly make
it available inside functions using the global statement.



More information about the thelist mailing list