This is the part of the article mentioned above that I thought might help you. Not the php part.
Quote:
The next step is to add the following code to your .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !yoursite\.com [NC]
RewriteCond %{HTTP_REFERER} !friendlysite\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule (.*) /showpic.php?pic=$1
|
The last line can be changed to any file you wish. Does not have to be a php file.
Could be changed to an asp file or an image file if you wish