Page 1 of 1
HTTP_REFERER Issue
Posted: Wed Jul 04, 2007 1:13 am
by dselva
Hi,
I have used $_SERVER['HTTP_REFERER']; in my web page, to check the referrer site url.
It work for some websites, Not for many. Huh
Even i used $_SERVER to list all the server variables, but not getting HTTP_REFERER variable.
So, please kindly help me to resolve this issue.
Thanks In advance,
dselva
Posted: Wed Jul 04, 2007 1:43 am
by John Cartwright
That (optional) information is received from the client, if the browser doesn't want to show it's refering website then theres nothing you can do about it.
Posted: Wed Jul 04, 2007 7:08 am
by miro_igov
And clients can modify the value. There are add-ons for FF. So never trust this.
Re: HTTP_REFERER Issue
Posted: Wed Jul 04, 2007 10:36 am
by The Phoenix
dselva wrote:I have used $_SERVER['HTTP_REFERER']; in my web page, to check the referrer site url.
Its optional, so some browsers and users choose not to pass it along.
It can also be blocked by corporate filters. If someone browses from work, and they use a proxy, you won't get a referrer.
It can also be blocked by plug-ins, add-ons, and by user action on a one-off basis, so it could work for a user one day, and not another.
When typing an url into a new window, or loading your page as a homepage on startup, or clicking on a saved link to your site, the referrer will be blank.
Its completely unreliable. Its nice to have, but do not rely on it.
dselva wrote:Even i used $_SERVER to list all the server variables, but not getting HTTP_REFERER variable.
Some webservers do not provide the http_referer variable at all.
Posted: Wed Jul 04, 2007 4:28 pm
by s.dot
If you are using this to track referrals to your web site, you would be better off having a database table with the names/ids of people who are referring traffic to you.
Then, when someone clicks their referral link to your site (that must contain their name/id), you can update the record in your referral table to increment the corresponding referral count for that name/id.