I need a php script that will allow a user to download a file for a fixed time and after xx hours have elapsed they can no longer download.
There should be an admin page in php which uses a config file.
The config file has the url to the true file to be downloaded.
When this admin page is loaded it shows that config file but the user can change it if needed. There is a box to enter the time to allow for the download(a text box where user enters 1 for one hour or .5 for 30 mins etc).
the Admin User clicks the Generate button and they are shown a link they can copy and paste which would look something like this:
<[login to view URL]>
The access= is a key which the admin script generates based on the current time(server time).
So we have 2 scripts, an [login to view URL] script that generates a download url key and a [login to view URL] script which shows a download link that allows the user to download the file it points to or can send user to a special download page.
This does not have to be a high security script, it only has to expire so no one can email it to their friends and let their friends download it later. THe admin page does not need any passwords, nothing fancy.
Here is how this would work.
Customer complains they cant download because they did not click the download button after checkout.
I run the admin script and get a link.
I email customer the link.
Customer uses that link within the time frame and the contents of an [login to view URL] page are loaded and that page has the link to the download.
If customer tries to download the next day, link does not work and instead loads a [login to view URL] page contents which says download time has expired.
This is a really simple script. It should not do anything with cookies. It should use the server time to generate an access key which is an encrypted expiration time and this key could also contain the url to the download file or webpage.
Let me know if you have any ideas on how you would do this.
Thanks