View Full Version : Links that expire
10-30-2008, 03:23 PM
I will be putting PDF files on my server and I want to link each one through my site so when a user clicks their link, they start downloading the file. This part I can do.
The hard part for me is getting these links to expire 7 days after upload or after the user has downloaded it once.
Any ideas. I know PHP is used.
10-30-2008, 03:52 PM
Either set a cookie on their machine, knowing they might just delete it, or have them log in to your system using PHP (or whatever you have) and set the time there. Then you just have them log in and check the date. You might want to ask this in the PHP forum.
10-31-2008, 05:22 AM
Then when you pull these links out of the database to display them to the user, use a WHERE clause in your sql query that selects only active links. Depending on your application you will need to check the time also and update the active field accordingly.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.