Re: expiring links
| From: | Jason Sheets | Date: | Mon, 05 May 2003 00:33:10 +0000 |
| Subject: | Re: expiring links | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146391@lists.php.net to get a copy of this message | ||
I'll describe a technique I've used:
When you authorize the user to access the link you generate a random identifier, then you insert the name of the file the user is allowed to download, the random identifier and a unix timestamp of the expiration time. Next you pass the user a link containing the random id and file name, when they click the link your script looks in the database for a record with the matching random id and filename and it verifies that the time is not later than the expiration time for the record, if it isn't it authorizes the download, if the current time is later than the time in the database or no record is found the link is expired.
Jason
Ryan A wrote:
Hi, I have been searching on google and sourceforge for how the heck you can have expiring links to digital downloads etc but either i am using the wrong keywords (likely) or there is no info there....(very unlikely) Do any of you guys have an idea? Cheers, -Ryan