[SOLVED] show referer

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
snpo123
Forum Commoner
Posts: 77
Joined: Sat Apr 17, 2004 6:31 pm

show referer

Post by snpo123 »

I was wondering if there was a way to see what page a person was refered from to my page. For example, if the person was on http://www.sitea.com, and they clicked a link on that site that leads to http://www.mysite.com, is there a way to find out what site a is, using php? thanks.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Code: Select all

if(!empty($_SERVER['HTTP_REFERER'])){
    echo $_SERVER['HTTP_REFERER'];
}
User avatar
snpo123
Forum Commoner
Posts: 77
Joined: Sat Apr 17, 2004 6:31 pm

Post by snpo123 »

works perfectly. Thanks
Post Reply