/    Sign up×
Community /Pin to ProfileBookmark

Basic fulfillment of digital products

Anyone – I just want a source for the HTML? code to allow a paid customer to advance from a PayPal (etc.) paid page to a page where they can download the digital product. Hopefully something simple to move the paid customer through to his download button and fullfillment of the order. Thanks

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@toicontienSep 18.2006 — From what I gather, it won't be as simple as some HTML code. The simplest approach would be to make a static HTML page that links to the file. Problem is someone could copy the link location and then download the digital content in the future for free. You really could use some server side scripting. The basic process would be as follows:

1) User submits their payment. The download page comes up.

2) (Assuming you are using PHP) The download page is a PHP file, lets say it's called download.php. The PHP script creates a session for the user. The session ID is stored in a cookie that gets sent with the download page. The download link is a URL to another PHP file with some variable data appended to it. Something like:

file.php?name=myprogram.exe&key=234524j2yhgnw3452jh4lkynfskl

The key=foo is a random number or string generated by download.php. This key is then stored in the PHP session. The page, download.php, is sent to the user along with the cookie that contains the PHP session Id.

3) When the user clicks on the Download link, it goes to file.php. The cookie containing the session Id is also sent to file.php automatically by the browser. File.php then looks at the session Id in the cookie data sent to it, and opens the proper session on the server.

4) It checks the $_GET['key'] variable (the key=foo in the URL to the downloadable file) to see if it matches the key stored in the PHP session. If it does, file.php sets the proper file headers to be something like application/whatever. Then somehow (I'm not entirely sure) sends the file to be downloaded to the user.

EDIT

5) You would also set the session to expire after X number of minutes or hours so someone can't hack the system and use an old or pre-used session Id later on. After the session expires, it would be removed from the server so the user can't repeatedly download the file without starting the download process again. Be sure to notify the user of how long they are able to download the file.

You would also want to build in a way for people who have already paid for the product to download it again, but since the security would be handled server side, you'd also want to keep track of a product or registration code too.
Copy linkTweet thisAlerts:
@LeeUSep 18.2006 — [URL=http://www.withinweb.com/phpipnmonitor/index.php]This script[/URL] works great and is easy to implement. It works with PayPal. I use it for music downloads but it also works with ebooks and other items.
Copy linkTweet thisAlerts:
@pioneerauthorSep 19.2006 — That's a lot to swallow for a newbie. Thanks so much. I'll have to chew on this a bit, but it does sound like it would be a secure way to fulfill the order. Again, thanks for helping.
Copy linkTweet thisAlerts:
@pioneerauthorSep 19.2006 — LeeU, thanks for the pointer to a completed script. I will check it out.
×

Success!

Help @pioneer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...