Php predefines $ _ SERVER instances. All instances starting with $ _ SERVER are predefines service variables ., _ Server instance

Source: Internet
Author: User

Php predefines $ _ SERVER instances. All instances starting with $ _ SERVER are predefines service variables ., _ Server instance

<Style> body {background: # EEE ;}</style> <? Phpheader ("Content-type: text/html; charset = utf8"); echo "error_reporting => ". error_reporting (E_ALL ). "<br>"; echo "PHP_SELF => ". $ _ SERVER ['php _ SELF ']. "<br>"; # File Name of the script being executed, which is related to document root. Echo "argv =>". $ _ SERVER ['argv']. "<br>"; # parameters passed to the script. Echo "argc => ". $ _ SERVER ['argc ']. "<br>"; # contains the number of command line parameters passed to the Program (if it is in command line mode ). Echo "GATEWAY_INTERFACE =>". $ _ SERVER ['Gateway _ interface']. "<br>"; # The CGI standard version used by the SERVER. For example, "CGI/1.1 ". Echo "SERVER_NAME =>". $ _ SERVER ['server _ name']. "<br>"; # NAME of the SERVER host on which the script is currently running. Echo "SERVER_SOFTWARE =>". $ _ SERVER ['server _ soft']. "<br>"; # the string of the server id, which is provided in the header of the Response Request. Echo "SERVER_PROTOCOL =>". $ _ SERVER ['server _ Protocol']. "<br>"; # name and version of the communication PROTOCOL when requesting the page. For example, "HTTP/1.0 ". Echo "REQUEST_METHOD =>". $ _ SERVER ['request _ method']. "<br>"; # request method when accessing the page. For example, "GET", "HEAD", "POST", and "PUT ". Echo "REQUEST_TIME => ". date ("Y-m-d H: s: I", $ _ SERVER ['request _ time']). "<br>"; # The request start timestamp echo "QUERY_STRING => ". $ _ SERVER ['query _ string']. "<br>"; # query string. Echo "DOCUMENT_ROOT =>". $ _ SERVER ['document _ root']. "<br>"; # ROOT directory of the DOCUMENT where the script is currently running. Defined in the server configuration file. Echo "HTTP_ACCEPT =>". $ _ SERVER ['HTTP _ ACCEPT ']. "<br>"; # Accept of the current request: Content in the header. Echo "HTTP_ACCEPT_CHARSET =>". $ _ SERVER ['HTTP _ ACCEPT_CHARSET ']. "<br>"; # Accept-Charset of the current request: Content in the header. Example: "iso-8859-1, *, UTF-8 ". Echo "HTTP_ACCEPT_ENCODING =>". $ _ SERVER ['HTTP _ ACCEPT_ENCODING ']. "<br>"; # Accept-Encoding of the current request: Content in the header. For example, "gzip ". Echo "HTTP_ACCEPT_LANGUAGE =>". $ _ SERVER ['HTTP _ ACCEPT_LANGUAGE ']. "<br>"; # Accept-Language of the current request: Content in the header. For example, "en ". Echo "HTTP_CONNECTION =>". $ _ SERVER ['HTTP _ connection']. "<br>"; # CONNECTION of the current request: Content in the header. For example, "Keep-Alive ". Echo "HTTP_HOST =>". $ _ SERVER ['HTTP _ host']. "<br>"; # The requested HOST: the content in the header. Echo "HTTP_REFERER =>". $ _ SERVER ['HTTP _ referer']. "<br>"; # The a tag redirects to the URL of the previous page of the current page. Echo "HTTP_USER_AGENT =>". $ _ SERVER ['HTTP _ USER_AGENT ']. "<br>"; # User-Agent of the current request: Content in the header. Echo "HTTPS => ". $ _ SERVER ['https']. "<br>"; # If you access through https, it is set to a non-empty value (on); otherwise, offecho "REMOTE_ADDR =>" is returned ". $ _ SERVER ['remote _ ADDR ']. "<br>"; # browsing the IP address of the user on the current page. Echo "REMOTE_HOST =>". $ _ SERVER ['remote _ host']. "<br>"; # The HOST Name of the user on the current page is being viewed. Echo "REMOTE_PORT =>". $ _ SERVER ['remote _ port']. "<br>"; # The PORT used by the user to connect to the SERVER. Echo "SCRIPT_FILENAME =>". $ _ SERVER ['script _ filename']. "<br>"; # the absolute path name of the currently executed SCRIPT. Echo "SERVER_ADMIN => ". $ _ SERVER ['server _ admin']. "<br>"; # administrator information echo "SERVER_PORT => ". $ _ SERVER ['server _ port']. "<br>"; # The port used by the server echo "SERVER_SIGNATURE => ". $ _ SERVER ['server _ SIGNATURE ']. "<br>"; # a string containing the server version and virtual host name. Echo "PATH_TRANSLATED =>". $ _ SERVER ['path _ TRANSLATED ']. "<br>"; # 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']. "<br>"; # contains the path of the current SCRIPT. This is useful when the page needs to point to itself. Echo "REQUEST_RUI =>". $ _ SERVER ['request _ URI ']. "<br>"; # URI required to access this page. For example, "/index.html ". Echo "_ FILE __=>". _ FILE _. "<br> ";

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.