note 22529 deleted from faq.installation by dams

From: Date: Fri, 21 Jun 2002 02:00:15 +0000
Subject: note 22529 deleted from faq.installation by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32081@lists.php.net to get a copy of this message
Att. K. Raju: The global variables associated with POST, GET, SESSION, etc. are no longer enabled by default (as of PHP 4.2.0 IIRC). You have two choices. 1. Say you have a text input named "myfield" in a form that uses the POST method -- you can employ the global variable $HTTP_POST_VARS["myfield"] or the superglobal $_POST["myfield"]. 2. Just using $myfield won't work any longer unless you explicitly set register_globals = On in your php.ini file. For security and other reasons (such as avoiding variable name collisions in your code), it's better if you update your legacy code (some judicious use of regexps can simplify this task) rather than enable globals. (Note that members of $_POST, $_GET, $_SESSION, etc. are superglobals and don't need to be redeclared within functions, etc. as is the case with $HTTP_POST_VARS, $HTTP_GET_VARS, etc.) For more info, http://www.php.net/manual/en/configuration.php#ini.register-globals and http://www.php.net/manual/en/language.variables.predefined.php (#language.variables.superglobals) would be excellent places to start. Hope you find this useful. jon stephens

« previous php.notes (#32081) next »