Re: Referer problem
| From: | Marek Kilimajer | Date: | Mon, 31 May 2004 17:52:59 +0000 |
| Subject: | Re: Referer problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187292@lists.php.net to get a copy of this message | ||
Merlin wrote:
Hi there, I am trying to prevent hotlinking of images by other servers. Pictures are generated on the fly by a php script, where I have included this code to prevent hot linking: $haystack = $_SERVER['HTTP_REFERER']; $needle = 'globosapiens';Many personal firewall softwares remove the referer header. The solution is simple, don't check the referer if it's blank. HTH$pos = strpos($haystack, $needle);if ($pos === false) { // not from globosapiens HEADER("Location:/g/p/2/hotlink_banner.gif"); exit; } It workes, but not for everybody. Some user tell me that they see the hotlink_banner.gif on my website as well. How is this possible? Has anybody an idea on where the error is, and how to fix it?` Thank you in advance, Merlin