Create a Download Link

I want to sell a software online. I’ll be using a PayPal for this purpose. And, what I want to do is send a download link after the user makes a payment via e-mail. This link should expire after (lets say 7 days). How would I implement this?




If you will save the date of sending the link code and also the link code “md5linkcodeesssdr55878ad” in the database. And in download.php you will compare
$_GET[‘linkcode’] with the database along with the system date now. To find out if the date in the database is less than the date now.(expired or not).

Parash, read up on the PayPal IPN (Instant Payment Notifications)… using that you can have PayPal notify your site (a script) when payment is successful, when that occurs you can have it run the server-side script to email the user a link to a script which checks the date of purchase and if it’s past the 7 days it’ll simply refuse to issue the link to the file itself. So in summary: one script for PayPal to setup and send the email, and one to redirect to the download if the payment was recent. :slight_smile: