<?php
echo 'documentroot:'.$_SERVER['DOCUMENT_ROOT'].'<br>'; //根目錄,在apache的配置文件裡定義:httpd.conf 比如:DocumentRoot "D:/work/php_root"
echo 'httphost:'.$_SERVER['HTTP_HOST'].'<br>'; //域名,比如:localhost
echo 'phpself:'.$_SERVER['PHP_SELF'].'<br>'; // 從根目錄到文件本身的路徑
echo 'script filename'.$_SERVER['SCRIPT_FILENAME'].'<br>'; //documentroot+phpself
echo 'request uri'.$_SERVER['REQUEST_URI'].'<br>'; //從根目錄開始所有的URL字符串,包括問號之後的字符
echo 'request method:'.$_SERVER['REQUEST_METHOD'].'<br>'; //請求的方法
echo 'name:'.$_REQUEST['name'].'<br>'; //請求參數的值
?>