Since PHP 4.2.0, the default value of register_globals is off. as a result, many variables can be used directly in the past, for example, $ PHP_SELF or the set SESSION variable cannot be accessed in the form of "$ variable name", which may cause a lot of inconvenience, but may improve security. Since PHP 4.2.0, the default value of register_globals is off. as a result, many variables can be used directly in the past, for example, $ PHP_SELF or the set SESSION variable cannot be accessed in the form of "$ variable name", which may cause a lot of inconvenience, but may 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'] original name (including path) of the client machine file ). $ _ FILES ['myfile'] ['type'] indicates 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'] 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. |