Thanks again guys, but can i clarify something with both of you:
etully:
I TOTALLY appreciate i cannot make it impossible to harvest my images and i also appreciate what you mean about there being no such thing as difficult. All i am trying to do is exactly what you said earlier:
He is concerned about someone seeing a graphic, finding the URL, pasting the URL into the browser, and viewing the graphic outside of the HTML page that normally includes that image. That problem can be stopped against casual web surfers but not against someone who is willing to invest an hour of their time
My question is (ignoring the security implications of people who really want to access them and are prepared to spend time) is how do i do this and protect them from casual surfers direct linking? You said:
No, you had it right the first time. The .htaccess trick will stop the average person from going directly to the image like this: http://www.mysite.com/image.jpg
but then you later said:
If you decide not to hand out the graphics to people who don't provide a referrer, then you will have real users who can't see the graphics on your web site.
I think i am missing something here, but how do i prevent casual users from doing exactly what you said (typing in the direct address and accessing the image) if hiding the referer is a bad idea? Think i might be being crazy!
sneakyimp:
I can't easily access any of your other images numbered 5 - 10, interestingly though in IE when i direct link to one of the first five images (by checking their direct address within properties) it displays the error image, however when i do the same in firefox i am able to view the correct images directly. For me this doesn't matter as i don't mind people directly accessing the images that they can see through my site (they would only be able to directly access them whilst they were still on that page anyway presumably), i just don't want them accessing (in this example) images 6 - 10 by changing the numbers within the filenames, which this does fine. I have been trying to work out exactly how you have done this based on your earlier post about using img codes, i'm thinking something like:
1) Each time a page on my site is loaded a unique code is generated which is stored as a session variable
2) Each image tag produces a unique image code by encrypting the image name and the current unique code (in the session variable) together, which is then passed within the img tag to image_feeder.php
3) image_feeder.php checks the unique image code by encrypting the current session code and image name and displays the correct image if the codes match otherwise displays an error image
This obviously isn't quite right as whilst what i have said would prevent hotlinking and opening say image06 without backwards engineering the hash function by using the session variable and the visible img tag codes, it does not prevent direct access to the visible images by just copying the direct link into a new window in either IE or Firefox. Which isn't necessarily a problem, but your way seems better as it at least does this in IE. Would you mind elaborating on how the above method works, as it all seems quite nice?
Thanks very much again guys, you are both being extremely helpful in not only getting to a solution, but helping me understand the intricacies of this much more, which is important really.