Predefined variable $

xiaoxiao2021-03-06  27

After the PHP manual, return H. Reserved word list

Predefined variable

From PHP 4.1.0, the preferred method of obtaining external variables is to use the overall global variable mentioned below. Prior to this, people either depend on Register_Globals or is a long predefined PHP array ($ http _ * _ vars). In PHP 5.0.0, long PHP predefined arrays can be shielded by setting register_long_arrays.

Server variable: $ _ server

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_server_vars.

$ _Server is an array containing a hEADERS, Paths and Script Locations. The entity of the array is created by the web server. You cannot guarantee that all servers can generate all information; the server may ignore some information or have some new information not listed below. This means that a large number of variables are described in the CGI 1.1 Specification, so you should carefully study it.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. You don't need to use Global $ _SERVER in a function or method; access it, just like $ http_server_vars.

$ Http_server_vars contains the same information, but is not an automatic global variable. (Note: $ http_server_vars and $ _server are different variables, and PHP handles them differently.)

If the register_globals directive is set, these variables are available in all scripts; that is, the $ _server and $ http_server_vars array are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

You may find that some $ _server elements listed below are not available. Note that if PHP is run in a command line, the elements listed below are almost unable to be effective (or there is no practical meaning).

"

PHP_SELF "

The file name of the script is currently executing, related to Document Root. For example, using $ _SERVER ['php_self'] in the script of the URL address http://example.com/test.php/foo.bar will get /Test.php/foo.bar.

If PHP is running in a command line, the variable is invalid.

"

ARGV "

Parameters passing to this script. When the script runs in the command line mode, the Argv variable passes the command line parameters of the program C language style. When the GET method is called, the variable contains the requested data.

"

ARGC "

A number of command line parameters that passed to the program (if run in command line mode).

"

Gateway_INTERFACE "

The version of the CGI specification used by the server. For example, "CGI / 1.1".

'

Server_name '

The name of the server host where the script is running the script. If the script is running on a virtual host, the name is determined by the value set by the virtual host.

'

Server_software '

The string of the server identifier is given in the header of the response request.

"

Server_Protocol "

Request the name and version of the communication protocol when the page is requested. For example, "http / 1.0".

"

Request_method

Request method when accessing the page. For example: "Get", "Head", "POST", "PUT". "

Query_string "

Query string of query.

"

Document_Root "

The document root directory where the script is currently running. Define in the server profile.

"

HTTP_ACCEPT "

Current request ACCEPT: The content of the header.

"

Http_accept_charset "

The current request for accept-charSet: the content of the head. For example: "ISO-8859-1, *, UTF-8".

"

Http_accept_encoding "

The current request for accept-encoding: the head of the head. For example: "gzip".

"

HTTP_ACCEPT_LANGUAGE "

Currently requested Accept-Language: The content of the header. For example: "en".

"

HTTP_CONNECTION "

Current requested Connection: The content of the header. For example: "Keep-alive".

"

Http_host "

The current request Host: The content of the header.

"

HTTP_REFERER "

Link to the URL address of the previous page of the current page. Not all user agents (browser) will set this variable, and some can also modify http_referer. Therefore, this variable is not always true.

"

HTTP_USER_AGENT "

The current request User_Agent: The content of the header. This string indicates the information of the user agent accessing the page. A typical example is: mozilla / 4.5 [en] (x11; u; linux 2.2.9 i586). You can also get this information using GET_BROWSER ().

"

REMOTE_ADDR "

The IP address of the current page user is being browsing.

'

REMOTE_HOST '

Browsing the host name of the current page user. Reverse domain name parsing based on the user's Remote_addr.

Note: The web server must be configured to establish this variable. For example, Apache needs to have Hostnamelookups on hostpd.conf. See gethostbyaddr ().

"

REMOTE_PORT "

The port used when the user is connected to the server.

"

Script_filename "

The absolute path name of the current execution script.

"

Server_admin "

This value indicates the Server_admin parameter in the Apache server configuration file. If the script is running on a virtual host, the value is the value of the virtual host.

"

Server_port "

The port used by the server. The default is "80". If you use an SSL secure connection, this value is the HTTP port you set.

"

Server_signature "

Contains a string of the server version and the virtual hostname.

"

Path_translated "

The basic path of the file system (not a document root directory) where the current script is located. This is the result after the server is virtual to the real path.

"

Script_name "

Contains the path to the current script. This is very useful when you need to point to yourself.

"

REQUEST_URI "

Access the URI required for this page. For example, "/ INDEX.html".

"

PHP_AUTH_USER "

When PHP is running in an Apache module, this variable is the username input by the user.

"

PHP_AUTH_PW "

When PHP runs in the Apache module, and the HTTP authentication function is being used, this variable is the password entered by the user.

"

Auth_type "

When PHP is running in the Apache module, this variable is the type of authentication.

Environment variable: $ _ ENV

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_env_vars.

When the parser is running, these variables are transformed from environment variables to the PHP global variable namespace (Namespace). Many of them are determined by the system running by PHP. A complete list is impossible. Please check your system's documentation to determine its specific environment variable.

Other environment variables (including CGI variables), whether PHP is running in a server module or in CGI processing, is listed here.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. In a function or method you don't need to use Global $_ENV; to access it, just like using $ http_env_vars.

$ Http_env_vars contains the same information, but is not an automatic global variable. (Note: http_env_vars and $ _ENV are different variables, and PHP handles them different ways.)

If the register_global order is set, these variables are available in all scripts; that is, the $ _ENV and $ http_env_vars array are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

HTTP Cookies: $ _ cookie

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_cookie_vars.

An array of variables passed through HTTP cookies. It is an automatic global variable.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. In a function or method you do not need to use Global $ _Cookie; to access it, just like $ http_cookie_vars.

$ Http_cookie_vars contains the same information, but is not an automatic global variable. (Note: http_cookie_vars and $ _cookie are different variables, and PHP processes their way.)

If the register_global order is set, these variables are available in all scripts; that is, the $ _cookie and $ http_cookie_vars array are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

HTTP get variable: $ _ get

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_get_vars.

An array of variables passed through the HTTP GET method. It is an automatic global variable.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. You don't need to use Global $ _Get in a function or method; just like using $ http_get_vars.

$ Http_get_vars contains the same information, but is not an automatic global variable. (Note: http_get_vars and $ _get are different variables, and PHP processes them different ways.)

If the register_global order is set, these variables are available in all scripts; that is, the $ _GET and $ HTTP_GET_VARS array are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

HTTP POST variable: $ _ POST Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_post_vars.

An array of variables passed through the HTTP POST method. It is an automatic global variable.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. In a function or method you do not need to use Global $ _POST; to access it, just like the $ http_post_vars.

$ Http_post_vars contains the same information, but is not an automatic global variable. (Note: http_post_vars and $ _post are different variables, and PHP handles them different ways.)

If the register_globals directive is set, these variables are available in all scripts; that is, the $ _POST and $ HTTP_POST_VARS arrays are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

HTTP file upload variable: $ _ files

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_post_files.

An array of uploaded file projects passed through the HTTP POST method. It is an automatic global variable.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. In a function or method you do not need to use Global $ _Files; to access it, just like using $ http_post_files.

$ Http_post_files contains the same information, but is not an automatic global variable.

If the register_global order is set, these variables are available in all scripts; that is, the $ _files and $ http_post_files arrays are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

REQUEST variable: $ _ request

Note: Use in PHP 4.1.0 and later. Previous versions, no equivalents.

Note: Before PHP 4.3.0, $ _ files is also included in the $ _REQUEST array.

This associated array contains all content in $ _GET, $ _ POST and $ _COOKIE.

This is a "superglobal" or can be described as an automatic global variable. This means that it is valid in all scripts. You don't need to use Global $ _REQUEST in a function or method.

If the register_global order is set, these variables are available in all scripts; that is, the $ _REQUEST array is separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables.

Session variable: $ _ session

Note: Use in PHP 4.1.0 and later. Previous versions, use $ http_session_vars.

Contains an array of Session variables in the current script. See the Session Function Document for more information.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. In a function or method you do not need to use Global $_SESSION; to access it, just like using $ http_session_vars.

$ Http_session_vars contains the same information, but is not an automatic global variable.

If the register_globals directive is set, these variables are available in all scripts; that is, the $ _SESSION and $ HTTP_SESSION_VARS array are separated. For related information, see the relevant chapters of security using Register Global. These individual global variables are not automatic global variables. Global variable: $ globals

Note: $ global is available in PHP 3.0.0 and later.

An array consisting of all defined global variables. The variable name is the index of the array.

This is a "superglobal" or can be described as an automatic global variable. This only means that it is valid in all scripts. You do not need to use Global $ GLOBALS in a function or method.

Previous error message: $ PHP_ERRORMSG

$ PHP_ERRORMSG is a variable that contains the previous error message content generated by PHP. This variable is valid after an error occurs and the TRACK_ERRORS option is turned on (default is closed).

Backward point forward reservation word list Previous predefined class

转载请注明原文地址:https://www.9cbs.com/read-81895.html

New Post(0)