A php script where you can view a directory, but only open one file?
-
Hiya, I have a website, i am familiar with PHP, HTML5, and a little perl and Asp. This is a problem i cant seem to figure out. I have a directory of files, i want people i give the link to, to be able to view the entire directory, but if they choose to download a file, only one will download, if they try another it says session expired. Ive tried with the basic .htaccess but its not advanced enough. I am guessing this will require mysql, which is fine. If anyone could point me in the right direction, i would be very grateful. Cheers
-
Answer:
MySQL is only going to work if these files are stored in a database. If they are, create an authorised page that displays an html form where the list of files in the database is shown via a select statement. Set the form so that only one option can be selected. On click, this can take them to a second page where the download starts and the session is destroyed. If they are just viewing the list of files in a directory uploaded to a host then you can alter the file permissions. However, this will not allow them to chose the one to download, you will have to decide.
Kay S at Yahoo! Answers Visit the source
Related Q & A:
- Does anyone know where i can get a portfolio for cheap?Best solution by Yahoo! Answers
- Does anyone know a site where I can get a complete Man of La Mancha script for free?Best solution by Yahoo! Answers
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
- Does Canada have a criminal database where you can look up offenders like you can here in the US?Best solution by Yahoo! Answers
- Where can I find a beach where I can have a fire and/or BBQ equipment in Jersey Shore or NY?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.