in reply to Getting the http referer

If you just want to see where visitors come from, use a log-file analyser like awstats, wwwstat, analog, webdruid or webalizer. (There are much more).
It would be nice to see on what os you are, to see what fits your needs best.