Well the script I wrote is installed on
www.USGrantsOnline.com
What the script does is lets me use a regular form submit button to submit the price, item number, and item name to PayPal. Then on the other end once they've paid the script checks to see if PayPal sends back a payment "Completed" message and confirms they paid the right amount. It also checks for a valid PayPal Transaction ID.
Then it opens the database and places the other information it gets back from Paypal::
Username (their email address is their username)
First Name
Last Name
Amount Paid
Date Paid
Item Name
Item Number
PayPal Transaction ID
The script also generates a random md5 password and submits that to their profile as well. Then it just displays the username and password there at the confirmation page and tells them to log in and sends them an email with the same information.
Once they log in they can see their download link The download link is a special PHP file that won't serve the file unless the user is logged in. Also it pulls the download from outside of the user's web root so no one can ever directly link to the download. They always have to log in to get the file and the script records a timestamp in their profile whenever they do so they can't say they never got it.
