Page 1 of 1

Passing filename from drop-down box to a download.php

Posted: Sun Jul 19, 2009 12:10 pm
by gbuck
I have a form with a <select> box that I populate with filenames from a folder on the server using PHP. I want to go to the Force Download dialog box when the submit button is clicked for the file the user has chosen in the drop-down box.

My PHP skills (apart from the most basic uses) at this point involve a lot of hunting in books and online for code samples I can tweak. My problem is that every example I've seen of a force-download script requires the typed filename.

It seems really simple but but I'm having trouble. Is the filename already passed as variable in the _POST array? I currently using a GET method for the form.

Re: Passing filename from drop-down box to a download.php

Posted: Sun Jul 19, 2009 12:24 pm
by jackpf
If you use the get method then it will be in the _GET array.

Re: Passing filename from drop-down box to a download.php

Posted: Sun Jul 19, 2009 4:46 pm
by gbuck
Thanks for your help, but now I have anew problem. I've sorted out the filename problem, but now "file_exists" returns false.
My new post (because passing the filename is no longer the issue):

viewtopic.php?f=1&t=103370