php 获得当前的脚本网址(只有路径) 复制代码 代码如下: function GetCurUrl() { if(!empty($_SERVER[“REQUEST_URI”])) { $scrtName = $_SERVER[“REQUEST_URI”]; $nowurl = $scrtName; } else { $scrtName = $_SERVER[“PHP_SELF”]; if(empty($_SERVER[“QUERY_STRING”])) { $nowurl = $scrtName; } else { $nowurl = $scrtName.”?”.$_SERVER[“QUERY