Script for displaying URL

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
I cant figure out how to display the URL of the current page, exactly as it appears in the address bar.
Would it be something like:

<?php
echo $SERVER['CURRENT_URL'];
?>

Thanx.
 
First: $_SERVER[] and not $SERVER[] :)
You have that information in environment variables like HTTP_HOST, REQUEST_URI and/or QUERY_STRING.
I think the mix of the first two will do what you need.
 
Back
Top