From the beginning of the PHP 4.2.0 version, the default value for the PHP directive register_globals is off (in the php.ini configuration file). This is a major change in PHP. What is register_globals for? It is used by PHP to control whether EGPCS (environment, GET, POST, Cookie, Server) variables are registered as global variables.
For example, for http://www.xx.php?var=2 var here, when on, you only need to use the $var, but at off, you must use $_get["var"] to receive the ~ Here's $_get is a PHP super global variable array. And it has the same nature:
$GLOBALS
Contains a reference to a variable in the global scope that is valid for each current script. The key of the array is the name of the global variable. $GLOBALS array is present starting with PHP 3.
$_server
Variables are set by the WEB server or are directly associated with the execution environment of the current script. Equivalent to the old array $HTTP _server_vars array, but and $_server is not a variable because PHP handles them differently, the same below. Although $http_server_varst and the following $http_*_vars are still available, it is never recommended that you use $http_*_vars again.
$_get
A variable that is submitted to a script via an HTTP get method. For example, a variable that is generated by a URL, a form's Get method.
Use way: $_get["XX"]; namely $xx; Same
$_post
A variable that is submitted to the script via the HTTP POST method. For example, a variable that is generated by the form's post method.
Use way: $_post["XX"];
$_cookie
A variable that is submitted to a script via an HTTP cookie method. For example, when reading a cookie value.
$_files
A variable submitted to the script via an HTTP POST file upload. My other article's further explanation of the file upload process is a more detailed description of its usage, which is no longer explained here.
$_env
Executes the variables that the environment submits to the script.
$_request
A variable that is submitted to a script through any user input mechanism, including Get,post,cookie, so the array is not trustworthy.
$_session
An array that holds the session variables.
You do not have to use Session_regisger to register a variable, and use the $_session["XX" to include the above process.