I want to limit access to images, therefore, I will be putting them outside of the web root, and when a user links to an image, it will authenticate them via user/pass from our database, and then (if authenticated) read the image file, and output it with the appropriate mime type.
Any image links will be something like:
<img src="/image.php?id=324fwqrefv35fq5">
Where the id is the imageId in the database.
Does this sound like a good way, and also- is there such code out there for php?