Re: Limit connection/download
| From: | Symeon Charalabides | Date: | Thu, 24 Jan 2002 20:57:59 +0000 |
| Subject: | Re: Limit connection/download | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11631@lists.php.net to get a copy of this message | ||
> I have a web site with a lot of files that are downloadable only by
> registered users. Session variables are used to keep track of who is logged and
> who is not (non-registered users can still browse the files, but not download
> them). Now, I would like to have a limit of one download/user. Is there a way I
> can limit the downloads with PHP or even an Apache configuration?
The simplest way is to set a flag via a cookie - very easy with PHP. Something
along the lines of:
if (DOWNLOAD)
setcookie('has_downloaded','1',time()+60*60*24*(number of days),'\');
However, knowledgable people can see through the cookies system and delete
the cookie from their PC, allowing them to download more.
As I said, it's only the simplest system...
Symeon Charalabides (cosmopolitan trainee)
------------------------------------------
http://www.webmate.gr