Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
The super global variable in PHP starts with PHP 4.2.0, the default value of Register_globals is off, so many variables that can be used directly, such as $PHP _self or the session variable you set, cannot be accessed in the form of "$ variable name". This may give you a lot of the same, but it can help improve safety. To access these variables, you need to use a PHP super global variable, as follows:
Variables are set by the WEB server or directly associated with the execution environment of the current script. An array $HTTP _server_vars similar to the old array. The previous $php_self corresponds to $_server[' php_self ', and you can use Phpinfo to view your $_server variables.
A variable that is submitted to the script via the HTTP GET method. An array $HTTP _get_vars similar to the old array.
A variable that is submitted to the script via the HTTP POST method. An array $HTTP _post_vars similar to the old array.
A variable that is submitted to the script via the HTTP cookie method. An array $HTTP _cookie_vars similar to the old array.
The variable currently registered to the script session. An array $HTTP _session_vars similar to the old array.
A variable that is submitted to the script via an HTTP POST file upload. An array $HTTP _post_files similar to the old array.
Executes the variables that the environment submits to the script. An array $HTTP _env_vars similar to the old array.
For $_files variables: (The File Field field is "MyFile")
$_files[' myfile ' [' Name ']
The original name of the client machine file (including the path).
$_files[' myfile ' [' type ']
The MIME type of the file requires the browser to provide support for that information, such as "Image/gif".
$_files[' myfile ' [' Size ']
The size of the uploaded file, in bytes.
$_files[' myfile ' [' Tmp_name ']
Temporary file names (including paths) stored on the server after the files have been uploaded.
$_files[' myfile ' [' Error ']
The error code associated with the file upload. [' ERROR '] was added in version PHP 4.2.0.
When register_globals in PHP.ini is set to ON, the $myfile _name is equivalent to $_files[' myfile ' [' name '], $myfile _type equivalent to $_files[' myfile ' [' Type '] and so on.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.