Super global variables in PHP. The Super global variable in PHP starts from PHP4.2.0, and the default value of register_globals is off. as a result, many variables that can be directly used in the past can be used, for example, $ PHP_SELF or the hyperglobal variable in ses php you set starts from PHP 4.2.0, and the default value of register_globals is off. as a result, many previous variables that can be directly used are available, for example, $ PHP_SELF or the SESSION variable you set cannot be accessed in the form of "$ variable name". This may bring you a lot of changes, but it helps improve security. To access these variables, you need to use PHP hyper-global variables as follows:
$ _ SERVER
Variables are set by the Web server or directly associated with the execution environment of the current script. Similar to the old $ HTTP_SERVER_VARS array. The previous $ PHP_SELF corresponds to $ _ SERVER ['php _ SELF ']. you can use phpinfo to view your $ _ SERVER variable.
$ _ GET
Variables submitted to the script through the http get method. Similar to the old $ HTTP_GET_VARS array.
$ _ POST
Variables submitted to the script through the http post method. Similar to the old $ HTTP_POST_VARS array.
$ _ COOKIE
Variables submitted to the script through HTTP Cookies. Similar to the old $ HTTP_COOKIE_VARS array.
$ _ SESSION
The variable currently registered to the script session. Similar to the old $ HTTP_SESSION_VARS array.
$ _ FILES
Variables submitted to the script by uploading the http post file. Similar to the old $ HTTP_POST_FILES array.
$ _ ENV
Variables submitted to the script in the execution environment. Similar to the old $ HTTP_ENV_VARS array.
========================================================== ======================================
For the $ _ FILES variable: (the file field is "myfile ")
$ _ FILES ['myfile'] ['name']
The original name (including the path) of the client machine file ).
$ _ FILES ['myfile'] ['type']
The MIME type of the file, which must be supported by the browser, for example, "image/gif ".
$ _ FILES ['myfile'] ['size']
Size of the uploaded file, in bytes.
$ _ FILES ['myfile'] ['tmp _ name']
Temporary file name (including path) stored on the server after the file is uploaded ).
$ _ FILES ['myfile'] ['error']
The error code related to the file upload. ['Error'] is added in PHP 4.2.0.
When php. when register_globals in ini is set to on, $ myfile_name is equivalent to $ _ FILES ['myfile'] ['name'], $ myfile_type is equivalent to $ _ FILES ['myfile'] ['type.
Starting from ipv4.2.0, the default value of register_globals is off. as a result, many previous variables that can be directly used, such as $ PHP_SELF or your set SES...