//defining the URL $url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); //check for a trailing slash. if((substr($url,-1) =='/') OR (substr($url,-1) =='/')) { $url=substr(url,0,-1); //chop off the slash. }
1,确定URL://defining the URL$url = http://.$_SERVER[HTTP_HOST].dirname($_SERVER[PHP_SELF]);//check for a trailing slash.if((substr($url, -1) == /) OR (substr($url, -1) == /)) { $url = s