Super global variables in PHP
From PHP 4.2.0, the default value of register_globals is off. As a result, many previous variables can be directly used, 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']
Errors related to File UploadCode. ['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.