$_server Analysis of server variable _php skills

Source: Internet
Author: User
Tags http authentication http digest authentication

In-depth analysis of server variable $_server:

1, $_session[' php_self ']--gets the filename of the currently executing script

2, $_server[' Server_protocol ']--the name and version of the communication protocol when the page is requested. For example, "http/1.0".

3, $_server[' Request_time ']--time stamp at the start of the request. Valid from PHP 5.1.0. The same as the time function effect.

4, $_server[' argv ']--the arguments passed to the script. I tried it, and the Get method got the $_server[' argv '][0];post method could not assign him a value.

5, $_server[' server_name ']--Returns the current host name.

6, $_server[' Server_software ']--a string of server identities, given in the header information in response to the request. such as microsoft-iis/6.0

7, $_server[' Request_method ']--the request method when accessing the page. For example:, POST and put.

8, $_server[' query_string ']--a string of queries (query) (the first question mark in the URL?) After the content).

9, $_server[' Document_root ']--the document root directory where the script is currently running. Defined in the server configuration file. such as E:\server

10, $_server[' http_accept ']--the content of the current requested ACCEPT: header information.

11, $_server[' Http_accept_charset ']--the content of the current requested Accept-charset: header information. For example: "Iso-8859-1,*,utf-8".

12, $_server[' http_accept_encoding ']--the content of the current requested accept-encoding: header information. For example: "gzip".

13, $_server[' Http_accept_language ']--the content of the current requested accept-language: header information. For example: "en".

14, $_server[' http_connection ']--the content of the current requested CONNECTION: header information. For example: "Keep-alive".

15, $_server[' Http_host ']--the contents of the current requested HOST: header information.

16, $_server[' Http_referer ']--link to the URL address of the previous page of the current page.

17, $_server[' Http_user_agent ']--Returns the browser information used by the user. You can also use Get_browser () to get this information.

18, $_server[' HTTPS ']--if accessed through HTTPS, it is set to a non-null value, otherwise it returns off.

19, $_server[' REMOTE_ADDR ']--is browsing the current page user's IP address.

20, $_server[' Remote_host ']--the host name of the user who is browsing the current page. The reverse domain name resolution is based on the user's remote_addr. If local test returns 127.0.0.1

21, $_server[' Remote_port ']--the port the user uses to connect to the server. I didn't pass the test on this machine and I don't know why.

22, $_server[' Script_filename ']--the absolute pathname of the currently executing script. such as return E:\server\index.php

23, $_server[' Server_admin ']--this value indicates the Server_admin parameter in the Apache server configuration file. If the script is running on a virtual host, the value is the value of that virtual host

24, $_server[' Server_port ']--the port used by the server. The default is "80". If you are using SSL secure connections, this value is the HTTP port that the user sets.

25, $_server[' server_signature ']--a string containing the server version and the virtual host name.

26, $_server[' path_translated ']--the basic path of the file system (not the document root) where the current script resides. This is the result of a virtual to real-path image of the server. Apache 2 users can use Acceptpathinfo on in httpd.conf 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, include files).

28, $_server[' Request_uri ']--the URI required to access this page. For example, "/index.html".

29, $_server[' Php_auth_digest ']--As for the Apache module runtime, in the process of HTTP DIGEST authentication, this variable is set to the client sent "Authorization" http Header content (for further authentication operations).

30, $_server[' Php_auth_user ']--when PHP is running in the Apache or IIS (PHP 5 is ISAPI) module mode, and is using the HTTP authentication function, this variable is the user entered user name.

31, $_server[' PHP_AUTH_PW ']--when PHP is running in Apache or IIS (PHP 5 is ISAPI) module mode, and is using the HTTP authentication function, this variable is the user input password.

32, $_server[' Auth_type ']--when PHP is running in the Apache module mode, and is using the HTTP authentication function, this variable is the type of authentication.

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.