Here's my situation:
I have images in a database along with an original filename and verious other important stuff like size, dimensions, etc. I have made a PHP script that will retrieve from the database and output an image based on the database table ID, or randomly if none is specified. I have found that if you want to save the file, you will get the name to be the name of your PHP script.
I solved that problem using the following code:
header("Content-Disposition: filename=\"$filename\"");
This means now when I want to save, the save dialog now comes up with the correct file name. The problem is this though... I want to be able to speficify the filename, but not force open a save dialog if a user comes directly to this page.
I can use the script in an HTML <IMG...> tag and it works just fine, but I would like to be able to have it work when someone goes straight to the PHP page and not the page that is using the IMG tag. Any ideas?
Thanks in advance