page's current url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

page's current url

Post by ddragas »

How to get into variable page's current url?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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 ;)
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post 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)
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

... look at those variables ...

Code: Select all

echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

here's a little sample of how i used to do it

http://timvw.madoka.be/programming/php/geturl.txt
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Thank you all for reply and help
Post Reply