Starting 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 set session variables, cannot be accessed in the form of "$ variable name", which can cause a lot of inconvenience. But it helps to improve security. Starting 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 set session variables, cannot be accessed in the form of "$ variable name", which can cause a lot of inconvenience. But it helps to improve security. To access these variables, you need to use a PHP super global variable, as follows: The $_server variable is 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. $_get A variable that is submitted to the script via the HTTP GET method. An array $HTTP _get_vars similar to the old array. $_post the variables that are submitted to the script via the HTTP POST method. An array $HTTP _post_vars similar to the old array. $_cookie the variables that are submitted to the script via the HTTP cookie method. An array $HTTP _cookie_vars similar to the old array. $_session the variable currently registered to the script session. An array $HTTP _session_vars similar to the old array. $_files the variables submitted to the script via an HTTP POST file upload. An array $HTTP _post_files similar to the old array. $_env the variables that the execution 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). The MIME type of the $_files[' myfile ' [' type '] 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 '] files are uploaded after the temporary file name (including the path) stored on the server. $_files[' myfile ' [' Error '] and the file upload related error code. [' 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. |