Php predefines $ _ SERVER instances. all instances starting with $ _ SERVER are predefines service variables.

Source: Internet
Author: User
: This article mainly introduces php pre-defined $ _ SERVER instances. all instances starting with $ _ SERVER are pre-defined service variables ., If you are interested in the PHP Tutorial, refer.
 ". Error_reporting (E_ALL )."
"; Echo" PHP_SELF => ". $ _ SERVER ['php _ SELF ']."
"; # File name of the script being executed, which is related to document root. Echo "argv =>". $ _ SERVER ['argv']."
"; # Parameters passed to the script. Echo "argc =>". $ _ SERVER ['argc ']."
"; # Contains the number of command line parameters passed to the program (if running in command line mode ). Echo "GATEWAY_INTERFACE =>". $ _ SERVER ['gateway _ interface']."
"; # The CGI standard version used by the server. For example, "CGI/1.1 ". Echo "SERVER_NAME =>". $ _ SERVER ['server _ name']."
"; # Name of the server host where the script is currently running. Echo "SERVER_SOFTWARE =>". $ _ SERVER ['server _ soft']."
"; # The string identified by the server, which is provided in the header of the response request. Echo "SERVER_PROTOCOL =>". $ _ SERVER ['server _ protocol']."
"; # Name and version of the communication protocol on the request page. For example, "HTTP/1.0 ". Echo "REQUEST_METHOD =>". $ _ SERVER ['request _ method']."
"; # Request method for accessing the page. For example, "GET", "HEAD", "POST", and "PUT ". Echo "REQUEST_TIME =>". date ("Y-m-d H: s: I", $ _ SERVER ['request _ time'])."
"; # Request start timestamp echo" QUERY_STRING => ". $ _ SERVER ['query _ string']."
"; # Query string. Echo "DOCUMENT_ROOT =>". $ _ SERVER ['document _ root']."
"; # The root directory of the document where the script is currently running. Defined in the server configuration file. Echo "HTTP_ACCEPT =>". $ _ SERVER ['http _ ACCEPT ']."
"; # Accept of the current request: content in the header. Echo "HTTP_ACCEPT_CHARSET =>". $ _ SERVER ['http _ ACCEPT_CHARSET ']."
"; # Accept-Charset of the current request: content in the header. Example: "ISO-8859-1, *, UTF-8 ". Echo "HTTP_ACCEPT_ENCODING =>". $ _ SERVER ['http _ ACCEPT_ENCODING ']."
"; # Accept-Encoding of the current request: content in the header. For example, "gzip ". Echo "HTTP_ACCEPT_LANGUAGE =>". $ _ SERVER ['http _ ACCEPT_LANGUAGE ']."
"; # Accept-Language of the current request: content in the header. For example, "en ". Echo "HTTP_C> $ _ SERVER ['http _ connection']."
"; # Connection of the current request: content in the header. For example, "Keep-Alive ". Echo "HTTP_HOST =>". $ _ SERVER ['http _ host']."
"; # Host of the current request: content in the header. Echo "HTTP_REFERER =>". $ _ SERVER ['http _ referer']."
"; # The URL of the previous page to which the tag is redirected. Echo "HTTP_USER_AGENT =>". $ _ SERVER ['http _ USER_AGENT ']."
"; # User-Agent of the current request: content in the header. Echo "HTTPS =>". $ _ SERVER ['https']."
"; # If you access through https, it is set to a non-null value (on); otherwise, offecho" REMOTE_ADDR => "is returned ". $ _ SERVER ['remote _ ADDR ']."
"; # Browsing the IP address of the user on the current page. Echo "REMOTE_HOST =>". $ _ SERVER ['remote _ host']."
"; # The host name of the user browsing the current page. Echo "REMOTE_PORT =>". $ _ SERVER ['remote _ port']."
"; # The port used by the user to connect to the server. Echo "SCRIPT_FILENAME =>". $ _ SERVER ['script _ filename']."
"; # The absolute path name of the currently executed script. Echo "SERVER_ADMIN =>". $ _ SERVER ['server _ admin']."
"; # Administrator information echo" SERVER_PORT => ". $ _ SERVER ['server _ port']."
"; # Echo" SERVER_SIGNATURE => ". $ _ SERVER ['server _ SIGNATURE ']."
"; # A string containing the server version and virtual host name. Echo "PATH_TRANSLATED =>". $ _ SERVER ['path _ TRANSLATED ']."
"; # The basic path of the file system where the current script is located (not the root directory of the document. Echo "SCRIPT_NAME =>". $ _ SERVER ['script _ name']."
"; # Contains the path of the current script. This is useful when the page needs to point to itself. Echo "REQUEST_RUI =>". $ _ SERVER ['request _ URI ']."
"; # URI required to access this page. For example, "/index.html ". Echo "_ FILE __=>". _ FILE __."
";

The preceding section describes the php predefined $ _ SERVER instance. all instances starting with $ _ SERVER are predefined service variables ., Including some content, hope to be helpful to friends who are interested in PHP tutorials.

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.