- 可可科科
-
你可以实用 _SERVER变量和_ENV变量
下面是我的phpinfo中的php变量:
_SERVER["SCRIPT_NAME"] /php/index.php
_SERVER["HTTP_COOKIE"] cdb_sid=tcSZ7o
_SERVER["AUTH_PASSWORD"] no value
_SERVER["AUTH_TYPE"] no value
_SERVER["AUTH_USER"] no value
_SERVER["CONTENT_LENGTH"] 0
_SERVER["CONTENT_TYPE"] no value
_SERVER["PATH_TRANSLATED"] c:inetpubwwwroot
_SERVER["QUERY_STRING"] (url中问号后边的部分)
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["REMOTE_HOST"] 127.0.0.1
_SERVER["REMOTE_USER"] no value
_SERVER["REQUEST_METHOD"] GET
_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["SERVER_SOFTWARE"] Microsoft-IIS/6.0
_SERVER["APPL_MD_PATH"] /LM/W3SVC/1/Root/php
_SERVER["APPL_PHYSICAL_PATH"] E:webphp
_SERVER["INSTANCE_ID"] 1
_SERVER["INSTANCE_META_PATH"] /LM/W3SVC/1
_SERVER["LOGON_USER"] no value
_SERVER["REQUEST_URI"] /php/index.php
_SERVER["URL"] /php/index.php
_SERVER["SCRIPT_FILENAME"] E:webphpindex.php
_SERVER["ORIG_PATH_INFO"] /php/index.php
_SERVER["PATH_INFO"] no value
_SERVER["ORIG_PATH_TRANSLATED"] E:webphpindex.php
_SERVER["DOCUMENT_ROOT"] c:inetpubwwwroot
_SERVER["PHP_SELF"] /php/index.php
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["HTTP_KEEP_ALIVE"] 300
_SERVER["HTTP_HOST"] localhost
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 5.2; zh-CN; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
_SERVER["REQUEST_TIME"] 1146214357
_SERVER["argv"]
Array
(
)
_SERVER["argc"] 0
_ENV["ALLUSERSPROFILE"] C:Documents and SettingsAll Users
_ENV["ClusterLog"] C:WINDOWSClustercluster.log
_ENV["CommonProgramFiles"] C:Program FilesCommon Files
_ENV["COMPUTERNAME"] LIUBO
_ENV["ComSpec"] C:WINDOWSsystem32cmd.exe
_ENV["FP_NO_HOST_CHECK"] NO
_ENV["NUMBER_OF_PROCESSORS"] 1
_ENV["OS"] Windows_NT
_ENV["Path"] C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;E:Program FilesMySQLMySQL Server 5.0in;c:php;c:phpext
_ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_ENV["PROCESSOR_ARCHITECTURE"] x86
_ENV["PROCESSOR_IDENTIFIER"] x86 Family 15 Model 4 Stepping 1, GenuineIntel
_ENV["PROCESSOR_LEVEL"] 15
_ENV["PROCESSOR_REVISION"] 0401
_ENV["ProgramFiles"] C:Program Files
_ENV["SystemDrive"] C:
_ENV["SystemRoot"] C:WINDOWS
_ENV["TEMP"] d:
_ENV["TMP"] d:
_ENV["USERPROFILE"] C:Documents and SettingsDefault User
_ENV["windir"] C:WINDOWS
相信很容易能看懂的,如果还有不懂,可以查php手册