Current URL with PHP (PHP)
by spyka (http://www.spyka.net)
You can use this simple function to get the current URL of the page. Example usage is shown below and in demo
Code:
<?
function getCurrentPage() {
$domain .= "http://";
$domain .= $_SERVER['HTTP_HOST'];
$domain .= $_SERVER['REQUEST_URI'];
return $domain;
}
echo "The current URL is: ".getCurrentPage()."!";
?>