Tom's Newbie Booster

PHP Picture Protection
Defense against picture theft

Freeware
Version 1.0



Description

This is something I've been trying to write for a long time. As we all know, there's a lot of people out there on the web who will want to link to your pictures. You'll also find that there are a large number of pic harvesters out there too. This is a script I wrote which is designed to stop all of that. Further more, the script sends you an email each time it looks like someone is trying to hotlink to your pictures.


Features

• Easy to install.
• Emails you each time there's a possible violation.
• Checks the referring domain name to see if it's allowed to use the pic.
• Minimal load on the server (very efficient...)
• Best of all - it's FREE! :-)


Working Example

First let's look at a typical picture page with the script in use:

Picture page

It looks like an every day picture page with the pic showing in the middle. But if you view the source code, you'll see the image is added like this:

<IMG SRC=image.php?image=01.jpg>

The image is not added to the page directly. Instead, the page inserts a script which then runs a check on the page asking for the script, and then decides if it should load the picture.

It would be impossible to hotlink to this picture for two main reasons. First, the hotlinker does not know which folder this image is stored in. The image is actually stored in this folder:

http://www.tomsnewbiebooster.com/resources/php-pic-protect/some-silly-name-9910/01.jpg

But that folder is NEVER mentioned on the page anywhere. You can name this folder anything you want to. The hotlinker will never know it's name.

Advanced note: If that's not enough protection for you, you CAN have your image folder stored in a level ABOVE the domain names - ie. not accessible at ALL from the web.

The second reason this picture is impossible to hotlink to is that if the hotlinker was to try to link to it like this:

<img src="http://www.tomsnewbiebooster.com/resources/php-pic-protect/image.php?image=01.jpg">

The script would pick up on it. The script checks which page is making the call to the image and then emails you if there's a potential hotlinker.

Here's an example of a page trying to hotlink to the example image in this fashion:

Hotlinking page

Oops. It doesn't look like the hotlinker is going to have a very good day. ;-) Not only did we just get emailed that they're trying to steal from us, but their surfers just learnt what a cheapskate they are.

Here's a copy of the email you'd get in this case:

Hotlinking Protection Script WARNING!
=====================================

It looks like someone is trying to HOTLINK to one or more of your pictures.

Here's the info I have for you.

Picture = some-silly-name-9910/01.jpg
Possible violator = http://www.amareur.com/test.html

I was able to block them from doing so - but it's probably a good idea to go and check it out anyway. :-)

=====================================

Hotlink Protection Robot



Download & Installation


Download the latest version HERE

1) Download the file and unzip it.

2) Edit the following three lines in image.php:

$email = "tom@tomsnewbiebooster.com";

(Email that the script will use when someone tries to hotlink your pics).

$domain = "tomsnewbiebooster.com";

(The domain which is allowed to link to the pics).

$images_folder = "some-silly-name-9910";

(The images folder. Important - this is the name of the folder holding your images. Name it something that the surfers will NEVER guess. You can name it anything you like, but make sure that the folder name, and the name you add here, match exactly.)

3) Upload images.php and thief.gif to your webspace.

4) Link to each picture like this:

<IMG SRC=image.php?image=01.jpg>

BUT - replace 01.jpg with the picture name.


Version Updates:

...
None yet




Enter Tom's Newbie Booster here
More tips, scripts and help...