$ _ SERVER http://a.liao1.com/sherry/auto/test.php for PHP functions
// Obtain the domain name or host address
Echo $ _ SERVER ['http _ host']."
"; // A.liao1.com
// Obtain the webpage address
Echo $ _ SERVER ['php _ SELF ']."
"; // Sherry/auto/test. php
// Obtain URL parameters
// Echo $ _ SERVER ["QUERY_STRING"]."
";
// Detailed address of the source webpage
// Echo $ _ SERVER ['http _ referer']."
";
Echo SITE_ROOT ."
"; // Http://a.liao1.com/sherry/auto
Echo $ _ SERVER ["SERVER_NAME"]; // a.liao1.com
?>
$ _ SERVER ["HTTP_USER_AGENT"] get the client browser model
Difference between the getenv ("REMOTE_ADDR") function and $ _ SERVER ['remote _ ADDR '] function
Function for retrieving the IP address of a visitor (client)
The getenv ("REMOTE_ADDR") function can get the IP address normally under apache, but it does not work at all in iis,
$ _ SERVER ['remote _ ADDR '] function, which can be used to obtain the visitor's IP address in apache, and is also valid in iis.