$_SERVER 的输出

<?
//test .php

 foreach($_SERVER as $key=>$value)
 {
      echo $key."=".$value."<br>";
 }
?>

 

 

测试结果中值得我们学习的有

UNIQUE_ID=SiHnuX8AAQEAADO4WxgAAAAG
HTTP_ACCEPT=*/*
HTTP_REFERER=http://192.168.1.99/test2/
HTTP_ACCEPT_LANGUAGE=zh-cn
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14.52; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
HTTP_HOST=192.168.1.99
HTTP_CONNECTION=Keep-Alive
HTTP_COOKIE=PHPSESSID=0b171e619fd85e8167a8197a9c3fe0fd
PATH=/sbin:/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE=

Apache/2.2.9 (Unix) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 Server at 192.168.1.99 Port 80


SERVER_SOFTWARE=Apache/2.2.9 (Unix) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0
SERVER_NAME=192.168.1.99
SERVER_ADDR=192.168.1.99
SERVER_PORT=80
REMOTE_ADDR=192.168.1.253

DOCUMENT_ROOT=/opt/lampp/htdocs
[email protected]
SCRIPT_FILENAME=/opt/lampp/htdocs/test2/test.php
REMOTE_PORT=2143
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
REQUEST_METHOD=GET
QUERY_STRING=
REQUEST_URI=/test2/test.php
SCRIPT_NAME=/test2/test.php
PHP_SELF=/test2/test.php
REQUEST_TIME=1243735993
argv=Array
argc=0

 

 

这个是在虚拟机中运行的结果

你可能感兴趣的:(windows,.net,unix,server,interface,encoding)