php获得当前的脚本网址_PHP教程
时间:2021-07-01 10:21:17
帮助过:15人阅读
//获得当前的脚本网址
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;
}
http://www.bkjia.com/PHPjc/318566.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/318566.htmlTechArticle//获得当前的脚本网址 functionGetCurUrl(){ if(!empty($_SERVER["REQUEST_URI"])){ $scriptName=$_SERVER["REQUEST_URI"]; $nowurl=$scriptName; }else{ $scriptName=$_SERVER["PHP_SE...