The old superglobals

Prior to php 4.1. there were no $_POST, $_GET, etc. superglobal arrays, but there were a bunch of other superglobals, like $HTTP_POST_VARS, $HTTP_GET_VARS and so on.
The guide mentions this in the forms chapter but there is a typo (repeated several times :) ) so I thought I should mention it.

The guide talks about these older vars with an underscore before the name, like $_HTTP_POST_VARS, $_HTTP_GET_VARS and so on which is not true. The correct names are $HTTP_POST_VARS, $HTTP_POST_VARS and so on, without the underscores.

BTW, a trick if you want use old code, written prior to 4.1.0. on newer php versions is to use something like:
< ?php
$_GET = &$HTTP_GET_VARS;
$_POST = &$HTTP_POST_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
?>

This entry was posted on Tuesday, March 29th, 2005 and is filed under PHP certification. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

Leave a Reply