PHP $ _ Server

Source: Internet
Author: User

In the past, I was curious that the website could obtain the IP address of the user accessing the current page. Now I know that the website uses the $ _ server parameter $ _ server ['remote _ ADDR '] in $ _ server.

You can input parameters to the $ _ server variable to extract valuable information related to the server and script.

$ _ Server ['php _ Self '] # The file name of the script being executed Document Root Related.
$ _ Server ['argv'] # Parameters passed to the script.
$ _ Server ['argc '] # Include passedProgramNumber of command line parameters (if running in command line mode ).
$ _ Server ['Gateway _ interface'] # The CGI Standard version. For example, "Cgi/1.1" .
$ _ Server ['server _ name'] # Name of the server host where the script is currently running.
$ _ Server ['server _ soft'] # The string identified by the server, which is in the header of the Response Request.
$ _ Server ['server _ Protocol'] # The name and version of the communication protocol on the request page. For example, & Quot; HTTP/1.0 & quot" .
$ _ Server ['request _ method'] # AccessPage request method. For example:"Get","Head","Post","Put".
$ _ Server ['query _ string'] # Query (Query) .
$ _ Server ['document _ root'] # The document root directory where the script is currently running. Defined in the server configuration file.
$ _ Server ['HTTP _ Accept '] # Current requested Accept: Header content.
$ _ Server ['HTTP _ accept_charset'] # Current requested Accept-charset: Header content. For example: "Iso-8859-1, *, UTF-8" .
$ _ Server ['HTTP _ accept_encoding '] # Current requested Accept-encoding: Header content. For example: "Gzip" .
$ _ Server ['HTTP _ accept_language '] # Current requested Accept-language: Header content. For example: "EN" .
$ _ Server ['HTTP _ connection'] # Current requested Connection: Header content. For example: "Keep-alive" .
$ _ Server ['HTTP _ host'] # Current requested Host: Header content.
$ _ Server ['HTTP _ referer'] # Link to the previous page of the current pageURLAddress.
$ _ Server ['HTTP _ user_agent '] # Current requested User_agent: Header content.
$ _ Server ['https']- If HTTPS Access , Is set to a non-empty value. (On) Otherwise, return Off
$ _ Server ['remote _ ADDR '] # Browsing the user'sIPAddress.
$ _ Server ['remote _ host'] # The host name of the user browsing the current page.
$ _ Server ['remote _ port'] # The port used by the user to connect to the server.
$ _ Server ['script _ filename'] # The absolute path name of the currently executed script.
$ _ 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 '] # The basic path of the file system (not the document root directory) where the current script is located.
$ _ Server ['script _ name'] # The path that contains the current script. This is useful when the page needs to point to itself.
$ _ Server ['request _ URI '] # The Uri . For example, "/Index.html" .
$ _ Server ['php _ auth_user '] # When PHP Run in Apache Module, and is using HTTP Authentication function. This variable is the user name entered by the user.
$ _ Server ['php _ auth_pw '] # When PHP Run in Apache Module, and is using HTTP Authentication function. This variable is the password entered by the user.
$ _ Server ['auth _ type'] # When PHP Run in Apache Module, and is using HTTP Authentication function. This variable is the authentication type.

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.