View Full Version : Get Referrer

07-01-2005, 05:23 PM
I want to know when someone visits my site from clicking the link in my AIM profile. I figure I'll just change the link from http://www.sumeetjain.com to http://www.sumeetjain.com?referrer=aim or something like that, but I don't know how that will tell me who actually is the referrer. I use ShortShat by Shaun Inman if that helps.

Does anyone know if there is a preset PHP get selector that will return the referrer?

07-01-2005, 05:45 PM
Most browsers send a header called "referer" that tells you what page they came in from. Not all do, and it can be mucked with. But it works for most people for most things they need it for.
No need to add special code to your links unless this gives you problems:

<?php echo($_SERVER['HTTP_REFERER']); ?>

07-01-2005, 06:41 PM
Only 100% effective way to to write a script that opens up your server logs and displays the results there