From the beginning of PHP4.2.0, the default value of the PHP command register_globals is off (in the php. ini configuration file). This is an important change of PHP. What is register_globals used? It is used by PHP to determine whether to convert EGPCS (Environment, GET, POS
From the beginning of PHP 4.2.0, the default value of the PHP command register_globals is off (in the php. ini configuration file). This is an important change of PHP. What is register_globals used? PHP is used to determine whether the EGPCS (Environment, GET, POST, Cookie, Server) variables are registered as global variables.
For example, for a http://www.xx.php? Var = 2 here var. when it is on, you only need to use $ var, but when it is off, you must use $ _ GET ['var'] to receive ~ $ _ GET is an array of PHP Super global variables. Like it, there are:
$ GLOBALS
Contains a reference variable that points to the global category of each current script. The key of the array is the name of the global variable. $ GLOBALS array exists from the beginning of PHP 3.
$ _ SERVER
Variables are set by the Web server or directly associated with the execution environment of the current script. It is equivalent to the old array $ HTTP_SERVER_VARS, but it is not a variable with $ _ SERVER. because PHP processes them differently, the same below. Although $ HTTP_SERVER_VARST and $ HTTP _ * _ VARS below can still be applied, it is not recommended that you apply $ HTTP _ * _ VARS.
$ _ GET
Variables submitted to the script through the http get method. For example, variables generated by GET methods of URLs and forms.
Application method: $ _ GET ['XX']; // that is, $ xx; the same below
$ _ POST
Variables submitted to the script through the http post method. For example, the variable generated by the form POST method.
Application method: $ _ POST ['XX'];
$ _ COOKIE
Variables submitted to the script through HTTP Cookies. For example, when reading the COOKIE value.
$ _ FILES
Variables submitted to the script after being uploaded through the http post file. In my other article, the usage of the file upload processing process has been described more specifically.
$ _ ENV
Variables submitted to the script in the fulfillment environment.
$ _ REQUEST
Variables submitted to the script by any user input mechanism, including GET, POST, COOKIE, and other methods, are not trustworthy.
$ _ SESSION
An array that stores SESSION variables.
You do not need to use session_regisger to register a variable. the above process is included in $ _ SESSION ['XX.