Detailed parameters and descriptions of $_server in PHP

Source: Internet
Author: User
Tags php programming

PHP programming often need to use some of the server's information, special $_server detailed parameters to organize, convenient for later use.

$_server[' php_self ']  #当前正在执行脚本的文件名, related to  document root. $_server[' argv ']  #传递给该脚本的参数. $_server[' argc ']  #包含传递给程序的命令行参数的个数 (if run in command-line mode). $_server[' gateway_interface ']  #服务器使用的  CGI  spec version. For example, "cgi/1.1". $_server[' server_name ']  #当前运行脚本所在服务器主机的名称. $_server[' Server_software ']  #服务器标识的字串, given in the header in response to the request. $_server[' Server_protocol ']  #请求页面时通信协议的名称和版本. For example, "http/1.0". $_server[' Request_method ']  #访问页面时的请求方法. For example:, POST, PUT. The string $_server[' query_string ']  #查询 (QUERY). $_server[' Document_root ']  #当前运行脚本所在的文档根目录. Defined in the server configuration file. $_server[' http_accept ']  #当前请求的  Accept:  head content. $_server[' Http_accept_charset ']  #当前请求的  Accept-Charset:  head content. For example: "Iso-8859-1,*,utf-8". $_server[' http_accept_encoding ']  #当前请求的  Accept-Encoding:  head content. For example: "gzip". $_server[' http_accept_language ' #当前请求的  Accept-Language:  head content. For example: "en". $_server[' http_connection ']  #当前请求的  Connection:  head content. For example: "Keep-alive". $_server[' Http_HOST ']  #当前请求的  Host:  header content. $_server[' http_referer ']  #链接到当前页面的前一页面的  URL  address. $_server[' http_user_agent ']  #当前请求的  User_Agent:  head content. $_server[' https '] -  if accessed via HTTPS, is set to a non-null value (on), otherwise off$_server[' REMOTE_ADDR ']  is returned #正在浏览当前页面用户的  IP  address. $_server[' Remote_host ']  #正在浏览当前页面用户的主机名. $_server[' Remote_port ']  #用户连接到服务器时所使用的端口. $_server[' Script_filename ']  #当前执行脚本的绝对路径名. $_server[' server_admin ']  #管理员信息 $_server[' server_port ']  #服务器所使用的端口 $_server[' server_signature '] # A string containing the server version and the virtual host name. $_server[' path_translated ']  the basic path to #当前脚本所在文件系统 (not the document root directory). $_server[' Script_name ']  #包含当前脚本的路径. This is useful when the page needs to point to itself. $_server[' Request_uri ']  #访问此页面所需的  uri. For example, "/index.html". $_server[' Php_auth_user ']  #当  PHP  runs in  Apache  module mode and is using  HTTP  authentication function, This variable is the user name entered by the user. $_server[' PHP_AUTH_PW ']  #当  PHP  runs in  Apache  module mode and is using  HTTP  authentication function, This variable is the password entered by the user. $_server[' Auth_type ']  #当 &nbsp php  runs in the  Apache  module mode and is using the  HTTP  authentication feature, which is the type of authentication.

Detailed parameters and descriptions of $_server in PHP

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.