To get the actual URL (non necessarily the one shown in the address bar because of URL rewriting):
$actual_url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
To get the URL shown in the address bar:
$displayed_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
No comments:
Post a Comment