This article introduces the usage of various parameters of $ _ SERVER environment variables. For more information, see this article. $ _ SERVER [#39; PHP_SELF #39;]: relative to the path of the website root directory and PH... this article introduces the usage of various parameters of $ _ SERVER environment variables. For more information, see this article.
$ _ SERVER ['php _ SELF ']: relative to the path of the website root directory and the PHP program name, it is related to document root. $ _ SERVER ['http _ referer']: URL of the previous page linked to the current page. $ _ SERVER ['script _ name']: the path to the website root directory and the NAME of the PHP program file. $ _ SERVER ['request _ URI ']: URI required to access this page. $ _ SERVER ['script _ filename']: the absolute path and file name of the currently running PHP program. $ _ SERVER ['path _ TRANSLATED ']: the basic PATH of the file system (not the document root directory) where the current PHP program is located. $ _ SERVER ['query _ string']: query string (the first question mark in the URL? After the content, but does not include # After the content ). $ _ SERVER ['argv']: the parameter passed to the current PHP program. $ _ SERVER ['argc ']: number of command line parameters passed to the program in command line mode. $ _ SERVER ['request _ time']: the timestamp at the start of the REQUEST, which is valid from PHP 5.1.0. $ _ SERVER ['request _ method']: The request method used to access the page, for example, "GET", "HEAD", "POST", or "PUT ". $ _ SERVER ['http _ ACCEPT ']: the Accept of the current request: the content of the header information. $ _ SERVER ['http _ ACCEPT_CHARSET ']: the Accept-Charset of the current request: the content of the header information. example: "ISO-8859-1, *, UTF-8 ". $ _ SERVER ['http _ ACCEPT_ENCODING ']: the Accept-Encoding of the current request: the content of the header information. example: "gzip ". $ _ SERVER ['http _ ACCEPT_LANGUAGE ']: the Accept-Language of the current request: the content of the header information. example: "zh-cn ". $ _ SERVER ['http _ connection']: the CONNECTION of the current request: the content of the header information. example: "Keep-Alive ". $ _ SERVER ['http _ host']: HOST of the current request: content of the header information. $ _ SERVER ['https']: if the PHP program is accessed through the HTTPS protocol, it is set to a non-empty value. $ _ SERVER ['php _ AUTH_DIGEST ']: During HTTP Digest Authentication when running as an Apache module, this variable is set to the "Authorization" HTTP header content sent by the client (for further authentication ). $ _ SERVER ['php _ AUTH_USER ']: When PHP runs in the Apache or IIS (PHP 5 is an ISAPI) module and is using the HTTP authentication function, this variable is the user name entered by the user. $ _ SERVER ['php _ AUTH_PW ']: When PHP runs in the Apache or IIS (PHP 5 is an ISAPI) module and is using the HTTP authentication function, this variable is the password entered by the user. $ _ SERVER ['auth _ type']: When PHP runs in the Apache module mode and is using the HTTP authentication function, this variable is the authentication TYPE. SERVER related $ _ SERVER ['document _ root']: the ROOT directory of the DOCUMENT where the PHP program is currently running. it is defined in the SERVER configuration file. $ _ SERVER ['gateway _ interface']: the CGI standard version used by the SERVER, for example, "CGI/1.1 ". $ _ SERVER ['server _ ADDR ']: IP address of the SERVER on which the PHP program is currently running. $ _ SERVER ['server _ name']: NAME of the SERVER on which the PHP program is currently running. $ _ SERVER ['server _ admin']: SERVER_ADMIN parameter in the Apache SERVER configuration file. $ _ SERVER ['server _ port']: PORT used by the SERVER. if SSL secure connection is used, this value is the HTTP port set by the user. $ _ SERVER ['server _ SIGNATURE ']: a string containing the SERVER version and virtual host name. $ _ SERVER ['server _ soft']: The string of the SERVER identifier, which is provided in the header of the response request. $ _ SERVER ['server _ protocol']: name and version of the communication PROTOCOL used to request the page, for example, "HTTP/1.0 ". miscellaneous $ _ SERVER ['http _ USER_AGENT ']: content of the User-Agent: header of the current request. this string indicates the information of the User Agent accessing the page. $ _ SERVER ['remote _ ADDR ']: the IP address of the user browsing the current page. $ _ SERVER ['remote _ host']: HOST name of the user browsing the current page. $ _ SERVER ['remote _ port']: PORT used by the user to connect to the SERVER
Article link:
Save this article for favorites!