Showing Website 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
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Showing Website URL?

Post by Mr Tech »

How can I create a file I can just upload to any directory or domain and have it pull the url from the address bar to display on the webpage. It needs to eb the FULL url.

Thanks
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Like this?

Post by neophyte »

Code: Select all

<?php echo 'http://'.$_SERVER&#1111;'SERVER_NAME'].$_SERVER&#1111;'REQUEST_URI']; ?>
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Post by Mr Tech »

Thanks for the quick response!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Post Reply