One way would be to simply point the url to a delivery script, and store the parameter in a database.
After a successful purchase, store some form of unique but identifiable URL-ending:
insert into purchases (expire_date,download_link) values (date_add(now(), interval 24 hour),'john_t_doe@wherever.com');
(The date_add above is set for now plus 24 hours, it can be any valid datetime expression.)
You then provide the custmer with their download link, built from the database entry:
http://www.example.com/cgi-bin/somescript.cgi?d=john_t_doe@wherever.com
When somescript.cgi is called it looks up the entry in the database, if it exists, open the file from a secret location and print it to the browser. The actual location of the file is never revealed. If the entry doesn't exist, it's expired and display your favorite too bad, so sad message.
A cron job would come along every hour or so and delete entries where expire_date <= now().
You could be even more slick about it with some mod_rewrite and make the URL
One way would be to simply point the url to a delivery script, and store the parameter in a database.
After a successful purchase, store some form of unique but identifiable URL-ending:
insert into purchases (expire_date,download_link) values (date_add(now(), interval 24 hour),'john_t_doe@wherever.com');
(The date_add above is set for now plus 24 hours, it can be any valid datetime expression.)
You then provide the custmer with their download link, built from the database entry:
http://www.example.com/cgi-bin/somescript.cgi?d=john_t_doe@wherever.com
When somescript.cgi is called it looks up the entry in the database, if it exists, open the file from a secret location and print it to the browser. The actual location of the file is never revealed. If the entry doesn't exist, it's expired and display your favorite too bad, so sad message.
A cron job would come along every hour or so and delete entries where expire_date <= now().
You could be even more slick about it with some mod_rewrite and make the URL
http://www.example.com/john_t_doe@wherever.com http://www.example.com/john_t_doe@wherever.com
You may also store your e-books in a directory that is only accessible by your script, and not directly via web: this will prevent accidentally "leaking" your e-books storage location: place a .htaccess with the following content (say, your e-books have .pdf extension):
<Files *.pdf>
Order Deny, Allow
Deny from All
</Files>
Title:
Invisible direct link
Description:
One way would be to simply point the url to a delivery script, and store the parameter in a database. After a successful purchase, store som...
...
Rating:
4