I have a PHP script which generates responses to answers submitted by a
form. The responses contain links to images. I'd like to stop users
guessing the names of other images and viewing them. I know I could use
random unguessable filenames, but I wondered if there was a more elegant
solution using PHP?
I know I can reference a php script in an img tag, and pass in a
parameter to specify which image to return, and I can use $HTTP_REFERER
to check that the script is being invoked by my page only. But the PHP
manual warns that this is set by the browser and cannot be relied upon.
So, is there a better solution?
--
Steve Loft
form. The responses contain links to images. I'd like to stop users
guessing the names of other images and viewing them. I know I could use
random unguessable filenames, but I wondered if there was a more elegant
solution using PHP?
I know I can reference a php script in an img tag, and pass in a
parameter to specify which image to return, and I can use $HTTP_REFERER
to check that the script is being invoked by my page only. But the PHP
manual warns that this is set by the browser and cannot be relied upon.
So, is there a better solution?
--
Steve Loft
Comment