PHP obtains server information from clients and PHP.

Source: Internet
Author: User
Tags http authentication

Server variable $ _ server details:

1. $ _ session ['php _ Self '] -- get the file name of the script being executed

2. $ _ server ['server _ Protocol'] -- name and version of the communication protocol when requesting the page. For example, "HTTP/1.0 ".

3. $ _ server ['request _ time'] -- the timestamp at the start of the request. Valid from PhP 5.1.0. The same effect as the time function.

4. $ _ server ['argv'] --
Parameters passed to the script. I tried the get method to get $ _ server ['argv'] [0]. The post method cannot assign a value to him.

5. $ _ server ['server _ name'] -- returns the current host name.

6. $ _ server ['server _ soft'] -- the string of the server identifier, which is provided in the header information in the Response Request.
For example, Microsoft-IIS/6.0

7. $ _ server ['request _ method'] -- the request method used to access the page. For example, "get", "head", "Post", and "put ".

8. $ _ server ['query _ string'] -- query string (the first question mark in the URL? ).

9. $ _ server ['document _ root'] -- the root directory of the document where the script is currently running. Defined in the server configuration file. E:/Server

10. $ _ server ['HTTP _ Accept '] -- accept of the current request: header information.

11. $ _ server ['HTTP _ accept_charset '] -- accept-charset of the current request:
Header information. Example: "iso-8859-1, *, UTF-8 ".

12. $ _ server ['HTTP _ accept_encoding '] -- accept-encoding of the current request:
Header information. For example, "gzip ".

13. $ _ server ['HTTP _ accept_language '] -- accept-language of the current request:
Header information. For example, "en ".

14. $ _ server ['HTTP _ connection'] -- connection of the current request:
Header information. For example, "keep-alive ".

15. $ _ server ['HTTP _ host'] -- Host of the current request: header information.

16. $ _ server ['HTTP _ referer'] -- link to the URL of the previous page of the current page.

17. $ _ server ['HTTP _ user_agent '] -- return the browser information used by the user. You can also use get_browser () to obtain this information.

18. $ _ server ['https'] -- If accessed through https, it is set to a non-null value; otherwise, off is returned.

19. $ _ server ['remote _ ADDR '] -- browsing the IP address of the user on the current page.

20. $ _ server ['remote _ host'] -- the host name of the user on the current page is being viewed. Reverse Domain name resolution is based on the user's
Remote_addr. If the local test returns 127.0.0.1

21. $ _ server ['remote _ port'] -- the port used by the user to connect to the server. I did not pass the test on the local machine. I don't know why.

22. $ _ server ['script _ filename'] -- the absolute path name of the currently executed script. E:/Server/index. php

23. $ _ server ['server _ admin'] -- This value specifies server_admin in the Apache server configuration file.
Parameters. If the script runs on a VM, the value is the value of that VM.

24. $ _ server ['server _ port'] -- the port used by the server. The default value is "80 ". If SSL secure connection is used, the value is the HTTP
Port.

25. $ _ server ['server _ signature '] -- a string containing the server version and virtual host name.

26. $ _ server ['path _ translated '] --
The basic path of the file system (not the document root directory) where the current script is located. This is the result of a virtual image to a real path on the server. Apache 2 users can use
Acceptpathinfo on to define path_info.

27. $ _ server ['script _ name'] -- contains the path of the current script. This is useful when the page needs to point to itself. _ File __
Contains the absolute path and file name of the current file (for example, including the file ).

28. $ _ server ['request _ URI '] -- URI required to access this page. For example, "/index.html ".

29. $ _ server ['php _ auth_digest '] -- when running as an Apache module, perform HTTP Digest
During authentication, this variable is set to the "Authorization" HTTP header content sent by the client (For further authentication ).

30. $ _ server ['php _ auth_user '] -- when PHP runs in Apache or IIS (PHP 5 is
ISAPI) module, and the HTTP authentication function is in use. This variable is the user name entered by the user.

31. $ _ server ['php _ auth_pw '] -- when PHP runs in Apache or IIS (PHP 5 is
ISAPI) module and HTTP authentication is in use. This variable is the password entered by the user.

32. $ _ server ['auth _ type'] -- when PHP runs in the Apache module mode 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.