/**
* 返回基准URL
*/
function baseurl()
{
if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 1 || $_SERVER['HTTPS'] === 'on' || $_SERVER['SERVER_PORT'] == 443))
{
$protocol = 'https://';
}
else
{
$protocol = 'http://';
}
return $protocol.dirname($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
网友评论