function base_url(){
$pathinfo = pathinfo($_SERVER["SCRIPT_NAME"]);
$dirname = $pathinfo["dirname"];
if($_SERVER["HTTPS"] == "on"){
$protocol = "https";
}else{
$protocol = "http";
}
$base_url = $protocol."://".$_SERVER["HTTP_HOST"].$dirname."/";
return $base_url;
}
No comments:
Post a Comment