I think it would make more sense to test for the referring page, rather than
the server name... in other words, if the request for the image came from a
page on your server, display the image; otherwise display the alternate
image. I think the name is HTTP_REFERER but my memory might be off.
A few notes about this, though: since your "real" image is available as
yourdomain.com/imageshidden/realimage.gif, it's still possible for someone
to download it. Your script is a slight deterrent, not a prevention.
I have had problems with some browsers not including the HTTP_REFERER header
when loading images (or scripts) for a page. For the site visitors who are
using these browsers--IE for Mac is one of them--the "you are stealing"
image would always be displayed, even when the visitor tried to load the
page correctly.
The best advice I have heard--and it's been posted many times, in many
different groups--is "don't post images that you absolutely don't want
anyone to download." That's the only sure-fire way to prevent leeching.
"John Smith" <jo**@nospam.spam> wrote in message
news:bj**********@hercules.btinternet.com...
Hi,
I've been trying to play around with a simple script to stop people
stealing images (and bandwidth) but without much success :
strFolder="imageshidden"
strServer = lcase(Request.ServerVariables("server_name"))
If strServer="www.joebloggs.com" Then
strPic = strFolder & Request.QueryString("pic")
Else
strPic = "img/youarestealing.gif"
End If
Response.Redirect strPic
Is there an online tutorial or script for this ?
Thanks
John