468,247 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

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.

Apr 27 '06 #1
1 1848
hu***********@gmail.com wrote:
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.


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["candownload"] = "Y";
3) redirect to a downloadscript (download.php)
4) In download.php you check for $_SESSION["candownload"] == "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_<machinename> on W$) must have readpermissions on the file.

Regards,
Erwin Moller
Apr 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marcel - IDUG Europe 2005 | last post: by
5 posts views Thread by Jenni | last post: by
33 posts views Thread by Snis Pilbor | last post: by
65 posts views Thread by Spiros Bousbouras | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.