Reply to Re: How to register before download?

Your name:

Reply:


Posted by Erwin Moller on 04/27/06 15:52

hundredandten@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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация