: This article describes how to obtain SERVER information ($ _ SERVER) in PHP. For more information about PHP tutorials, see. The most common
$ _ SERVER ['http _ ACCEPT_LANGUAGE '] // browser language $ _ SERVER ['remote _ ADDR'] // IP address of the current user. $ _ SERVER ['remote _ host'] // Current User HOST name $ _ SERVER ['request _ url'] // URL
$ _ SERVER ['remote _ port'] // PORT. $ _ SERVER ['server _ name'] // NAME of the SERVER host. $ _ SERVER ['php _ SELF '] // file name of the script being executed $ _ SERVER ['argv'] // parameters passed to the script. $ _ SERVER ['argc '] // Number of command line parameters passed to the program. $ _ SERVER ['gateway _ interface'] // CGI standard version. $ _ SERVER ['server _ soft'] // string of the SERVER identifier $ _ SERVER ['server _ protocol'] // name and version of the communication PROTOCOL when requesting the page $ _ SERVER ['request _ method'] // request method for accessing the page $ _ SERVER ['query _ string'] // QUERY). $ _ SERVER ['document _ root'] // ROOT directory of the DOCUMENT where the script is currently running $ _ SERVER ['http _ ACCEPT '] // The Accept of the current request: header content. $ _ SERVER ['http _ ACCEPT_CHARSET '] // The Accept-Charset of the current request: content in the header. $ _ SERVER ['http _ ACCEPT_ENCODING '] // Accept-Encoding of the current request: content in the header $ _ SERVER ['http _ connection'] // CONNECTION of the current request: header content. For example, "Keep-Alive ". $ _ SERVER ['http _ host'] // HOST of the current request: content in the header. $ _ SERVER ['http _ referer'] // URL of the previous page linked to the current page. $ _ SERVER ['http _ USER_AGENT '] // User_Agent of the current request: content in the header. $ _ SERVER ['https'] // if accessed through HTTPS, it is set to a non-empty value (on ), otherwise, off $ _ SERVER ['script _ filename'] # The absolute path name of the currently executed SCRIPT is returned. $ _ SERVER ['server _ admin'] # Administrator information $ _ SERVER ['server _ port'] # PORT used by the SERVER $ _ SERVER ['server _ signature'] # A string containing the server version and virtual host name. $ _ SERVER ['path _ TRANSLATED '] # Basic PATH of the file system where the current script is located (not the root directory of the document. $ _ SERVER ['script _ name'] # contains the path of the current SCRIPT. This is useful when the page needs to point to itself. $ _ SERVER ['php _ AUTH_USER '] # When PHP runs onApacheModule, and the HTTP authentication function is in use. this variable is the user name entered by the user. $ _ SERVER ['php _ AUTH_PW '] # When PHP runs onApacheModule, and the HTTP authentication function is in use. this variable is the password entered by the user. $ _ SERVER ['auth _ type'] # When PHP runs onApacheModule mode, and the HTTP authentication function is being used. this variable is the authentication type.
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above describes how to obtain SERVER-related information ($ _ SERVER) in PHP, including Apache content, and hope to help friends who are interested in PHP tutorials.