PHP Page Expiration

Hi guys,
Here is my scenario…

I am planning to sell an e-book online…which I want to send as a link via e-mail…I want the download link to expire after certain days…So, could you guys give me some idea as how I can accomplish this.



You store the date and time of each purchase in your database. The link you send points to a PHP script which looks up the order in the database then sends the file. If the date and time of the purchase is more than 3 days in the past, it can present an “expired” message instead of sending the file.