欢迎来到福编程网,本站提供各种互联网专业知识!

php获得当前的脚本网址

发布时间:2007-12-10 作者: 来源:转载
//获得当前的脚本网址functionGetCurUrl(){if(!empty($_SERVER["REQUEST_URI"])){$scriptName=$_SERVER["REQUEST_URI"];$nowurl=$scriptName;}else{$scriptName=$_SERVER["PHP_SELF"];if(empty($_SERVER["QUERY_STRING"]))$nowurl=$scriptName;else$n
//获得当前的脚本网址
functionGetCurUrl(){
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;
}

相关推荐