> I recently discovered the reason why the traffic is rising so high on
my
> server. Some people are "stealing" bandwidth. They include
> the link of an image into a forum posting. Now everytime somebody
reads
> this
> threat on the other site this image is
> served by my server!! No one cares about one image, but they become
> dramaticly a lot!
> 
> Is there a reason how to find out that the image is not include into
my
> html
> code, but into the other site code?
> 
> A great idea would be showing a kind of a watermark on this images if
they
> are included inside other websites.
> 
> $_SERVER[HTTP_REFERRER] does not help. But there might be another
method I
> do not know of.
> 
> Thank you for any help and hints on this topic!

The best way to handle this is probably with your web server. There are
some rewrite rules that you can apply to the images/ directory that'll
redirect a request for an image to another image if the request doesn't
come from your site. We used to do this on a site I helped run. If
someone tried to hotlink to one of our images, they got an add for some
rather queer looking male swimsuits... :)

Or, the other option is to implement this in PHP. Store your images
outside of the web root. Serve them all up through a PHP page.

<img src="foo.php?id=111">

foo.php will make sure that the request is valid by possibly checking a
session value or HTTP_REFERRER. If the request is valid, send the
headers and use readfile() to send the image data. If it's not, send the
data for another image or nothing. 

The downside to this is it's harder to manage and all images requests
will be running through PHP pages.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to