meloncrack Posted October 21, 2008 Share Posted October 21, 2008 If I wanted to sell a software or file that I have and a customer makes the purchase on my website (paypal) upon payment, how can I get my e-mail to e-mail the customer a link to download automatically, and the e-mail link disintegrates after 24-48 hours. How can I do something like this OR where can I get information about this. Thanks a lot. Send a message via AIM to meloncrack meloncracked Send a message via MSN to meloncrack meloncrack@live.com Send a message via Yahoo to meloncrack meloncrack@yahoo.com Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/ Share on other sites More sharing options...
trq Posted October 21, 2008 Share Posted October 21, 2008 Once the users purchase goes through, store an random id in a database. Send the customer your link with this random id attached. Once the download is complete remove the id from the database. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-670933 Share on other sites More sharing options...
JonnoTheDev Posted October 21, 2008 Share Posted October 21, 2008 Use a unique key string within the url to download the file. Store this key in a db along with a timestamp. i.e. http://yourdomain.com/download.php?key=123456789 On the download page - get the timestamp from the db using the key and you can then check whether or not the download has expired. Present the user with a message if the download has expired or kill completely if an invalid key is used. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-670934 Share on other sites More sharing options...
revraz Posted October 21, 2008 Share Posted October 21, 2008 What is a good way to determine that the download is complete? Once the users purchase goes through, store an random id in a database. Send the customer your link with this random id attached. Once the download is complete remove the id from the database. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-670951 Share on other sites More sharing options...
meloncrack Posted October 22, 2008 Author Share Posted October 22, 2008 Well i'm no very little about php coding so there are people that probably sell it right? Or is this easy enough for me to read a tutorial and do? By the way I use 1and1.com for hosting. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-671420 Share on other sites More sharing options...
CroNiX Posted October 22, 2008 Share Posted October 22, 2008 What is a good way to determine that the download is complete? Once the users purchase goes through, store an random id in a database. Send the customer your link with this random id attached. Once the download is complete remove the id from the database. You can't really, but you can have the link active for only x amount of time, enough time for anybody to be able to download it. Unless they were using a 300 baud modem like in my Commodore 64 days LOL. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-671509 Share on other sites More sharing options...
MasterACE14 Posted October 22, 2008 Share Posted October 22, 2008 read the PHP tutorial on Tizag Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-671519 Share on other sites More sharing options...
aeonsky Posted October 22, 2008 Share Posted October 22, 2008 Paypal provides their own API for such things. Just store the time that the transaction was made, with 'time();' and each time the download is accessed (through a unique key), check if time > 48 hours. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-671524 Share on other sites More sharing options...
d_barszczak Posted October 22, 2008 Share Posted October 22, 2008 A common way to do this would to have a time limit on the id in the database as Neil pointed out but if you use php to send the file I think you can then remove the key from the database once the file has been send. // Use the database to get the file name and file location for the submited key. header('Content-Disposition: attachment; filename="download.jpg"'); readfile('images/100.jpg'); // Remove the key from the database. This would download the file images/100.jpg which has been stored on the webserver to avoid duplicate names and sent to the user in a more user friendly way. You could also timelimit a cookie so the user can download it again if it fails. Usually you get about 24 hours. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-671525 Share on other sites More sharing options...
meloncrack Posted October 22, 2008 Author Share Posted October 22, 2008 Hey I figured it out, for those that want to know the same solution to my problem is this. It's called a digital goods delivery software. But it's super expensive almost more expensive then the cost of your cable internet. But so I have a different question. Instead of buying these company's softwares is there another way to go about this? Can anyone give me any suggestions on learning how to do it myself without these expensive third-party programs? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-672208 Share on other sites More sharing options...
revraz Posted October 22, 2008 Share Posted October 22, 2008 We don't know, you haven't told us how they handle it. Quote Link to comment https://forums.phpfreaks.com/topic/129413-how-can-i-sell-a-particular-software-and-then-when-they-buy-it-it-is-automatically-e/#findComment-672212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.