Page 1 of 1

get a referring URL

Posted: Thu Oct 13, 2005 5:43 am
by paladaxar
Is there any way that I can find out what site linked to my site? I want to get the URL and store it in a DB. But, I dont want anything past the .com. so if (for example) someone got to my site by clicking on an ad on eBay, and the referring URL was http://www.ebay.com/categories/books/calculus.php I would only want "http://www.ebay.com". Is this possible?

Thanx,
Josh

Posted: Thu Oct 13, 2005 7:42 am
by feyd
parse_url(). Be aware that looking for a referrer in a request is very unreliable as it's extremely easy to fake and there are routers that strip that information from a request..

Posted: Thu Oct 13, 2005 8:32 am
by chrys
... but if you reaaally want it, try: getenv( "HTTP_REFERER" );