Re: download counter?
- From: "Petr Vileta" <stoupa@xxxxxxxxxxxxx>
- Date: Thu, 8 Feb 2007 14:00:07 +0100
"lorento" <laurente1234@xxxxxxxxx> píse v diskusním príspevku news:1170907412.690300.77580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I think you can make simple php application for count the download,Better then redirecting is to read file in php script, send to browser and write to sql table after a file is complete send.
like:
when people click http://host/download.php?file=xyz.zip, the
download.php will increase the counter and the people will forwarded
into file xyz.zip
these are not the code but the algorithm:
1. create mysql table
create table counter (filename varchar(100), counter int);
insert into counter values ('xyz.zip', 0);
2. create download.php file:
//increase the counter table
update counter set counter = counter + 1 where filename like
'$_GET[file]'
//forward to file
header ("location: xyz.zip");
1. open file
2. read file and send to browser until EOF
3. increase counter in DB
This avoid a situation when user cancel download.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.)
.
- Follow-Ups:
- Re: download counter?
- From: devospice
- Re: download counter?
- References:
- download counter?
- From: devospice
- Re: download counter?
- From: lorento
- download counter?
- Prev by Date: Re: preg_replace question - ASCII characters?
- Next by Date: Re: create rss xml
- Previous by thread: Re: download counter?
- Next by thread: Re: download counter?
- Index(es):