HTTP_REFERER Variable Blocked - Why?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thewebmushroom
Forum Newbie
Posts: 3
Joined: Fri May 23, 2003 10:47 am
Location: Yorkshire, UK

HTTP_REFERER Variable Blocked - Why?

Post 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?
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Re: HTTP_REFERER Variable Blocked - Why?

Post 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.
thewebmushroom
Forum Newbie
Posts: 3
Joined: Fri May 23, 2003 10:47 am
Location: Yorkshire, UK

Re: HTTP_REFERER Variable Blocked - Why?

Post 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?
Post Reply