Common php $ _ SERVER

Source: Internet
Author: User
: This article mainly introduces common php $ _ SERVER. For more information about PHP tutorials, see. Element/code description
$ _ SERVER ['php _ SELF '] Returns the file name of the currently executed script.
$ _ SERVER ['gateway _ interface'] Return the CGI standard version used by the server.
$ _ SERVER ['server _ ADDR '] Returns the IP address of the server where the script is currently running.
$ _ SERVER ['server _ name'] Returns the host name (for example, www.w3school.com.cn) of the server where the script is currently running ).
$ _ SERVER ['server _ soft'] Returns the server ID string (for example, Apache/2.2.24 ).
$ _ SERVER ['server _ protocol'] The name and version of the communication protocol when the request page is returned (for example, "HTTP/1.0 ").
$ _ SERVER ['request _ method'] Return the request method used to access the page (for example, POST ).
$ _ SERVER ['request _ time'] Returns the start timestamp of the request (for example, 1577687494 ).
$ _ SERVER ['query _ string'] Returns the query string. if the query string is used to access this page.
$ _ SERVER ['http _ ACCEPT '] Returns the request header from the current request.
$ _ SERVER ['http _ accept_charset'] Returns the Accept_Charset header from the current request (e.g. UTF-8, ISO-8859-1)
$ _ SERVER ['http _ host'] Returns the Host header from the current request.
$ _ SERVER ['http _ referer'] Returns the complete URL of the current page (unreliable because not all user proxies support it ).
$ _ SERVER ['https'] Whether to use the security HTTP protocol to query scripts.
$ _ SERVER ['remote _ ADDR '] Returns the IP address of the user browsing the current page.
$ _ SERVER ['remote _ host'] Returns the host name of the user browsing the current page.
$ _ SERVER ['remote _ port'] Return the port number used to connect to the Web server on your machine.
$ _ SERVER ['script _ filename'] Returns the absolute path of the currently executed script.
$ _ SERVER ['server _ admin'] This value specifies the SERVER_ADMIN parameter in the Apache server configuration file.
$ _ SERVER ['server _ port'] The port used by the Web server. The default value is "80 ".
$ _ SERVER ['server _ SIGNATURE '] Returns the server version and virtual host name.
$ _ SERVER ['path _ TRANSLATED '] The basic path of the file system (non-document root directory) where the current script is located.
$ _ SERVER ['script _ name'] Returns the path of the current script.
$ _ SERVER ['script _ URI '] Returns the URI of the current page.

The table above lists the most important elements that you can access in $ _ SERVER:

The above section describes the common php $ _ SERVER, including some content, and hopes to help those who are interested in PHP tutorials.

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.