php获得当前的脚本网址
程序员文章站
2022-11-15 17:52:34
//获得当前的脚本网址
function getcururl(){
if(!empty($_server[...
//获得当前的脚本网址
function getcururl(){
if(!empty($_server["request_uri"])){
$scriptname = $_server["request_uri"];
$nowurl = $scriptname;
}else{
$scriptname = $_server["php_self"];
if(empty($_server["query_string"])) $nowurl = $scriptname;
else $nowurl = $scriptname."?".$_server["query_string"];
}
return $nowurl;
}