Page 1 of 1

HTTP_REFERER Variable Blocked - Why?

Posted: Fri May 23, 2003 10:47 am
by thewebmushroom
I have written a hit counter script that records the referring url to a web page. However, my ISP "blocks" the HTTP_REFERER variable (so it cannot be accessed in PHP or Perl) for "security reasons" which they would not explain so I have had to use a work around in JavaScript (grabbing the document.referer). This works OK unless JavaScript is turned off (obviously!).

Is there any way to get at the information in PHP and is there a valid security reason to block this information?

Re: HTTP_REFERER Variable Blocked - Why?

Posted: Fri May 23, 2003 12:53 pm
by scorphus
thewebmushroom wrote:Is there any way to get at the information in PHP?
Read this thread reply (by werlop), I think it can help you.

Regards,
Scorphus.

Re: HTTP_REFERER Variable Blocked - Why?

Posted: Sat May 24, 2003 2:51 am
by thewebmushroom
Thanks for that Scorphus.

Basically that is how I worked it out (although I used Perl rather than PHP to generate a blank image - not sure why to be honest!).

My ideal solution would be to avoid using JS altogether, although I guess that this is impossible if the HTTP_REFERER is blocked by the server configuration of my ISP. Only solution is to change my ISP or setup my own server!

Any ideas why they wish to block this variable?