Download Link !

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>On Fri, 25 Mar 2005 11:25:09 -0800, AN@S <php@xxxxxxx> wrote:
> Hello,
>
> When I purchased a website template from templatemonster.com, they sent
> the download link to my email, this link was active for only 2 or 3 days
> then it became inactive.
>
> Now I'm writing a script for selling website templates, the templates
> are uploaded to a certain folder, when someone buys a template a
> download link must be sent to his/her email address, and must  be active
> for only 2 or 3 days..
>
> Anyone have an idea how to start or where to start?
> Any link, any tutorial?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


A quick outline:

when a user purchases something, enter an unique string (try
md5(microtime()) although it's not completely unique) into the
database.

make a script that verifies the string...
verify.php?unique=12345............&user=johndoe

in verify.php you'd have something that compares $_GET['unique'] to
the database value, same with $_GET['user']

Then if that's good, send the download link. However, I would use
headers for downloads. By doing this you can place your template files
outside your web directory, which will make it more secure, obviously.

if you know how to use pear then i suggest using http_download. if you
don't, have a look at the fpassthru bit in the manual.

http://www.php.net/fpassthru

hth... it was a bit too simple but you have the general idea now :D

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux