Page 1 of 1

page's current url

Posted: Wed Apr 27, 2005 3:10 pm
by ddragas
How to get into variable page's current url?

Posted: Wed Apr 27, 2005 3:14 pm
by John Cartwright
try

Code: Select all

echo '<pre>'.print_r($_SERVER).'</pre>';
and see for yourself.. there is a whole load of variables you can use ;)

Posted: Wed Apr 27, 2005 3:26 pm
by ddragas
Thank you for quick reply.

What I want to acomplish is to get curent web address in format like in address bar (viewtopic.php?p=171938#171938)

Posted: Wed Apr 27, 2005 3:30 pm
by Todd_Z
... look at those variables ...

Code: Select all

echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

Posted: Wed Apr 27, 2005 4:59 pm
by timvw
here's a little sample of how i used to do it

http://timvw.madoka.be/programming/php/geturl.txt

Posted: Wed Apr 27, 2005 6:01 pm
by ddragas
Thank you all for reply and help