欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php获得当前的脚本网址_PHP教程

程序员文章站 2022-06-08 19:30: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;
}

www.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...