The meaning and usage of the $ _ SERVER variable in php

Source: Internet
Author: User
Meaning and usage of the $ _ SERVER variable in php $ _ SERVER [& amp; #39; PHP_SELF & amp; #39;] function usage # file name of the script being executed, related to documentroot. $ _ SERVER [& amp; #39; argv & amp; #39;] function usage # parameters passed to the script. $ _ SERVER [& amp; #39...

Meaning and usage of the $ _ SERVER variable in php $ _ SERVER ['php _ SELF '] function usage # file name of the script being executed, which is related to document root.

$ _ SERVER ['argv'] function usage # parameters passed to the script.

$ _ SERVER ['argc '] function usage # contains the number of command line parameters passed to the program (if running in command line mode ).

$ _ SERVER ['gateway _ interface'] function usage # The CGI standard version used by the SERVER. For example, "CGI/1.1 ".

$ _ SERVER ['server _ name'] function usage # NAME of the SERVER host where the script is currently running.

$ _ SERVER ['server _ soft'] function usage # string identified by the SERVER, which is provided in the header of the response request.

$ _ SERVER ['server _ protocol'] function usage # name and version of the communication PROTOCOL when requesting the page. For example, "HTTP/1.0 ".

$ _ SERVER ['request _ method'] function usage # request method when accessing the page. For example, "GET", "HEAD", "POST", and "PUT ".

$ _ SERVER ['query _ string'] function usage # query string.

$ _ SERVER ['document _ root'] function usage # ROOT directory of the DOCUMENT where the script is currently running. Defined in the server configuration file.

$ _ SERVER ['http _ ACCEPT '] function usage # Accept of the current request: content in the header.

$ _ SERVER ['http _ ACCEPT_CHARSET '] function usage # Accept-Charset of the current request: content in the header. Example: "ISO-8859-1, *, UTF-8 ".

$ _ SERVER ['http _ ACCEPT_ENCODING '] function usage # Accept-Encoding of the current request: content in the header. For example, "gzip ".

$ _ SERVER ['http _ ACCEPT_LANGUAGE '] function usage # Accept-Language of the current request: content in the header. For example, "en ".

$ _ SERVER ['http _ connection'] function usage # CONNECTION of the current request: content in the header. For example, "Keep-Alive ".

$ _ SERVER ['http _ host'] function usage # HOST of the current request: content in the header.

$ _ SERVER ['http _ referer'] function usage # Link to the URL of the previous page of the current page.

$ _ SERVER ['http _ USER_AGENT '] function usage # User_Agent of the current request: content in the header.

$ _ SERVER ['remote _ ADDR '] function usage # browsing the IP address of the user on the current page.

$ _ SERVER ['remote _ host'] function usage # the HOST name of the user browsing the current page.

$ _ SERVER ['remote _ port'] function usage # PORT used by the user to connect to the SERVER.

$ _ SERVER ['script _ filename'] function usage # The absolute path name of the currently executed SCRIPT.

$ _ SERVER ['server _ admin'] function usage # Administrator information.

$ _ SERVER ['server _ port'] function usage # PORT used by the SERVER.

$ _ SERVER ['server _ SIGNATURE '] function usage # a string containing the SERVER version and virtual host name.

$ _ SERVER ['path _ TRANSLATED '] function usage # Basic PATH of the file system where the current script is located (not the root directory of the document.

$ _ SERVER ['script _ name'] function usage # contains the path of the current SCRIPT. This is useful when the page needs to point to itself.

$ _ SERVER ['request _ URI '] function usage # URI required to access this page. For example, "/index.html ".

$ _ SERVER ['php _ AUTH_USER '] function usage # When PHP runs in the Apache module mode and uses the HTTP authentication function, this variable is the user name entered by the user.

$ _ SERVER ['php _ AUTH_PW '] function usage # When PHP runs in the Apache module mode and uses the HTTP authentication function, this variable is the password entered by the user.

$ _ SERVER ['auth _ type'] function usage # When PHP runs in the Apache module mode and uses the HTTP authentication function, this variable is the authentication TYPE.

$ _ SERVER ['php _ SELF '] function usage # file name of the script being executed, which is related to document root.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.