View Full Version : Selling Dijital Goods via Paypal
Odinn
08-19-2007, 10:19 AM
Hello
I am planning to make a small modification site for a php system , which I can sell these modifications and clients paying via paypal and downloading it. My only concern is , I need to make sure to hide the URL of the scripts or something such as constantly changing the location of the file thus people only able to download once.
How to arrange a such thing ? I prefer an open-source solution :p
Cirtex Andrew
08-19-2007, 01:48 PM
You could have the file sent to the user as an attachment. That way you do not need to keep changing the location of the file. Otherwise, you will have to arrange some sort of system to check if the download is completed and then run some code to change the name or location of the file.
Maybe you can do it through passwords too...
Odinn
08-19-2007, 03:09 PM
Aye I will try it , thanks alot for the tips :)
grant
08-20-2007, 04:48 AM
Store the files in your home directory above public_html. Then make a php script to check if they are logged-in, has rights to the file (they payed). Then use php readfile (http://www.php.net/readfile) to allow them to download. Example:
if ( user paid the price ){
header('Content-type: type of file'); //tell the browser what it is
header('Content-length: ' . filesize('/home/user/protected_files/my_file.doc') ); //how big the file is
readfile('/home/user/protected_files/my_file.doc');
}
else{
unauthorized.
}
dougp
08-20-2007, 08:03 AM
Store the files in your home directory above public_html. Then make a php script to check if they are logged-in, has rights to the file (they payed).
Was just getting ready to recommend that before I scrolled down and read your post :):) To add, there are a few free scripts around (may want to check on sourceforge) that also use this way of implementing a download system and should not be to difficult to edit them to work with your site. I do not recall the name of any off the top of my head, but if I get a chance to search for them will post back to let you know.
100% agree with grant though, it is a great way to do it and the end user cannot simply find the files as if they were in a more public location.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.