Find The Current Url Of The Page

Description: Finds the current URL of the page.

<?PHP
 
FUNCTION getCurrentPage() {
        $thedomain .= "http://";
     $thedomain .= $_SERVER['HTTP_HOST'];
     $thedomain .= $_SERVER['REQUEST_URI'];
     RETURN $thedomain ;
}
 
ECHO "The current URL is: ".getCurrentPage()."!";
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.