How to register before download?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hundredandten@gmail.com

    How to register before download?

    I am sure you have seen this in many sites: before letting you download
    the trial version of a software you have to register to get future
    email announcements.

    Is there a PHP script/s that does this already? I imagine it could be
    connected to Mailman (but doesn't have to). Another option is to use a
    CMS, but is it worth having a CMS just for this?

    Any ideas? I don't want to reinvent the wheel if I don't have to.

  • Erwin Moller

    #2
    Re: How to register before download?

    hundredandten@g mail.com wrote:
    [color=blue]
    > I am sure you have seen this in many sites: before letting you download
    > the trial version of a software you have to register to get future
    > email announcements.
    >
    > Is there a PHP script/s that does this already? I imagine it could be
    > connected to Mailman (but doesn't have to). Another option is to use a
    > CMS, but is it worth having a CMS just for this?
    >
    > Any ideas? I don't want to reinvent the wheel if I don't have to.[/color]

    Hi,

    It is not difficult, so I say: roll your own.

    try something like this:
    1) put your file somewhere where outside your webdirectory.
    2) after registration, set a $_SESSION["candownloa d"] = "Y";
    3) redirect to a downloadscript (download.php)
    4) In download.php you check for $_SESSION["candownloa d"] == "Y", if so,
    open the file for reading (from the place outside webdirectory) in PHP, and
    deliver it.

    Beware that you make the scripttimeout in download.php long (or infinite) in
    case somebody has a slow connection.

    Of course, PHP (user www-data/nobody/apache/whatever on *nix or user
    IUSR_<machinena me> on W$) must have readpermissions on the file.

    Regards,
    Erwin Moller

    Comment

    Working...