monkeytooth Posted June 7, 2011 Share Posted June 7, 2011 Not sure this is the direction I want to take per say with what I have in mind. Currently I have about 25 domains being redirected towards my main domain. What I have for those domains is a simple setup where I just plugged a simple single line php based header location style redirect. so if you go to domain5.com it will redirect and go to domain.com I set it up this way as I do have plans for these domains one day but not at the moment and rather than have them sitting there doing nothing I figured might as well just point them somewhere for now. With that I want to try and keep a hit count on which domain is bringing in traffic (if any) nothing fancy. I figured i'd do something as simple as grab the URL from the referencing domain. check it against a database table and if that domains in my table then +1 on the hits. My problem is however I try echo $_SERVER['HTTP_REFERER']; and I get "Undefined index: HTTP_REFERER" as an error. Then after a little reading about it I find HTTP_REFERER isn't a definitive solution as its user agent based so if the user agent doesnt set it then I don't get it. So in all I guess is whats the best way to approach finding what domain is coming to my main domain. I also want to use this with google, yahoo, bing and other systems of the like to see if I am getting any hits from them either. Would be nice to see what the keywords are to but im not gonna push my luck at the moment, currently I just want what .com, net, org, other is coming to my site thats it more is a plus but not going to whine if i dont get that right now. Quote Link to comment https://forums.phpfreaks.com/topic/238728-getting-the-referring-site/ Share on other sites More sharing options...
monkeytooth Posted June 7, 2011 Author Share Posted June 7, 2011 Quick addition, though I doubt it means anything to my question.. current hosting company: Host Gator. I am also using CodeIgniter as a framework on this site in mention Quote Link to comment https://forums.phpfreaks.com/topic/238728-getting-the-referring-site/#findComment-1226735 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.