In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces what is the use of $_SERVER in the server variable. It has certain reference value. Interested friends can refer to it. I hope you will have a lot of gains after reading this article. Let Xiaobian take you to understand it together.
Deep analysis of the server variable $_SERVER:
$_SESSION ['PHP_SELF'] --Get the filename of the script currently executing
$_SERVER ['SERVER_PROTOCOL'] --The name and version of the communication protocol at the time the page was requested. For example,"HTTP/1.0."
$_SERVER ['REQUEST_TIME']--timestamp of request start. Effective as of PHP 5.1.0. Same as time function.
$_SERVER ['argv '] --Parameters passed to the script. I tried it, and the get method gets $_SERVER ['argv '][0]; the post method doesn't give it a value.
$_SERVER ['SERVER_NAME'] --Returns the current hostname.
$_SERVER ['SERVER_SOFTWARE'] --The string identifying the server, given in the header message of the response request. Microsoft IIS/6.0
$_SERVER ['REQUEST_METHOD']--The method requested when accessing the page. For example: "GET","HEAD","POST","PUT".
$_SERVER ['QUERY_STRING']--string of query (first question mark in URL) the following content).
$_SERVER ['DOCUMENT_ROOT'] --The root directory of the document where the script is currently running. Defined in the server configuration file. E:\server
$_SERVER ['HTTP_ACCEPT']--The contents of the Accept: header information of the current request.
$_SERVER ['HTTP_ACCEPT_CHARSET']--The contents of the Accept-Charset: header information of the current request. For example: "iso-8859-1,*, utf-8".
$_SERVER ['HTTP_ACCETT_ENCODING'] --The contents of the Accept-Encoding: header information of the current request. For example: "gzip."
$_SERVER ['HTTP_ACCEPT_LANGUAGE'] --The content of the Accept-Language: header information of the current request. For example: "en."
$_SERVER ['HTTP_CONNECTION'] --The contents of the Connection: header information of the current request. For example: "Keep-Alive."
$_SERVER ['HTTP_HOST'] --The contents of the Host: header information of the current request.
$_SERVER ['HTTP_REFERER']--URL of the previous page that links to the current page.
$_SERVER ['HTTP_USER_AGENT'] --Returns information about the browser used by the user. You can also use get_browser() to get this information.
$_SERVER ['HTTPS '] --is set to a non-null value if accessed via https, otherwise returns off.
$_SERVER ['REMOTE_ADDR']--The IP address of the user who is viewing the current page.
$_SERVER ['REMOTE_HOST'] --The hostname of the user who is browsing the current page. Reverse domain name resolution is based on the REMOTE_ADDR of the user. If the local test returns 127.0.0.1
$_SERVER ['REMOTE_PORT']--The port the user uses to connect to the server. I failed the test on my own machine. I don't know why.
$_SERVER ['SCRIPT_FILENAME'] --The absolute path name of the currently executing script. For example, return E:\server\index.php
$_SERVER ['SERVER_ADMIN'] --This value indicates the SERVER_ADMIN parameter in the Apache server configuration file. If the script runs on a virtual host, the value is the value for that virtual host
$_SERVER ['SERVER_PORT'] --The port used by the server. The default is "80." If using SSL secure connections, this value is the HTTP port set by the user.
$_SERVER ['SERVER_SIGNATURE'] --String containing server version and virtual host name.
$_SERVER ['PATH_TRANSLATED'] --The base path of the file system where the current script resides (not the root directory of the document). This is the result after the server performs the virtual-to-real path mapping. Apache 2 users can define PATH_INFO using AcceptPathInfo On in httpd.conf.
$_SERVER ['SCRIPT_NAME'] --path containing 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 (e.g. contains the file).
$_SERVER ['REQUEST_URI']--URI required to access this page. For example,"/index.html".
$_SERVER ['PHP_AUTH_DIGEST']-When running as an Apache module, during HTTP Digest authentication, this variable is set to the "Authorization"HTTP header content sent by the client (for further authentication operations).
$_SERVER ['PHP_AUTH_USER']-When PHP is running in Apache or IIS (PHP 5 is ISAPI) module mode and HTTP authentication is being used, this variable is the username entered by the user.
$_SERVER ['PHP_AUTH_PW']-When PHP is running in Apache or IIS (PHP 5 is ISAPI) mode and HTTP authentication is being used, this variable is the password entered by the user.
$_SERVER ['AUTH_TYPE']-When PHP is running in Apache module mode and HTTP authentication is being used, this variable is the type of authentication.
Thank you for reading this article carefully, I hope Xiaobian shared "What is the use of $_SERVER in server variables" This article is helpful to everyone, but also hope that everyone will support more, pay attention to industry information channels, more relevant knowledge waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.