Sunday, December 6, 2009

Making download.php help?

I need help to set-up my MySQL database using php



I am trying to make a download.php which would let users to download files after 5 seconds.



The only problem is that my /download directory has many sub directory.



For example if someone wants to download FireFox, then firefox.exe is located in /download/FireFox/firefox.exe



and I want somewhat like this www.domain.com/download.php?fileid=firef... as an output URL to download. I know that I can use MySQL and setup a nice database to do something like this as long as fileid is unique.



Any ideas on how to setup the MySQL database so that I can easily add multiple files from different sub directory at the same time.



Thanks for reading the topic. Have a good one.



Making download.php help?kids myspace





set up a table that has a fields for GUID, program name, and relative path



GUID's assigned automatically (I use postgres, so whatever the equivalent to bigseral is would work)



name is whatever you want to display as the link name



relative path would be the location on the server of the file name.



might also want to include a boolean field or bit field for active or not...



then just write a simple interface to insert information in to the table, and your download.php file can call all the records, or just the active records with the name and relative path in a hyperlink.

No comments:

Post a Comment