How do I display the current url? I am using this to make an interstitial ad system. If the url is www.domain.com/?page=home
I need it to save that url as a variable. Anyone kno whow?
$_SERVER['REQUEST_URI']
i'm pretty sure it is
yeah that worked however I did:
echo $_SERVER['HTTP_HOST']; $_SERVER['REQUEST_URI'] ;
but that didnt work, but when I do
$_SERVER['REQUEST_URI'] ;
it shows exactly what I want, but not the domain name.
stupid me I forgot to put the echo....
Thanks a lot this does exactly what I wanted to do!
You could concatenate them too...
echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ; /* or */ $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ; echo $url; // Just makes it easier if you need to call the URL multiple times...