Get current URL in php
This commit is contained in:
parent
2a745b5304
commit
e0b8375e28
@ -95,4 +95,17 @@ function update() {
|
||||
|
||||
}
|
||||
|
||||
function pageURL() {
|
||||
|
||||
$pageURL = 'http';
|
||||
if (isset($_SERVER["HTTPS"])&&$_SERVER["HTTPS"]==="on") $pageURL .= "s";
|
||||
$pageURL .= "://";
|
||||
|
||||
if ($_SERVER["SERVER_PORT"]!="80") $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER['SCRIPT_NAME'];
|
||||
else $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER['SCRIPT_NAME'];
|
||||
|
||||
return $pageURL;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user