Page 1 of 1
downloaded counter
Posted: Fri Aug 23, 2002 1:35 am
by angelbear
Hi,
I just wanted to ask if it is possible to have a download counter wherein the counter adds 1 whenever theres is a successful download, not when the user click on the download button?
If so, pls tell me how? thanks!
angelbear
Posted: Fri Aug 23, 2002 8:38 am
by fatalcure
Code: Select all
<a href='download.php?fileid=$id'>Download File $id</a>
download.php
Code: Select all
$query="UPDATE table SET downloadcount=downloadcount+1 WHERE fileid=$fileid";
mysql_query($query);
then just use the header function to redirect them to the file.
Posted: Fri Aug 23, 2002 8:41 am
by llimllib
But no, you can never distinguish them hitting the download button and them having a successful download.
Posted: Fri Aug 23, 2002 8:42 am
by fatalcure
oh woops, i didnt read his question, hehe

my fault
Posted: Sat Aug 24, 2002 12:41 pm
by Pocketx
Thanks for the code! But where do you add the links to each file?
Posted: Sat Aug 24, 2002 2:18 pm
by hob_goblin
i think he was judging that you already knew a little php and would write the script with that as the concept...
Posted: Sat Aug 24, 2002 2:30 pm
by Takuma
hob_goblin wrote:i think he was judging that you already knew a little php and would write the script with that as the concept...
hehe, always happens this...
Posted: Sat Aug 24, 2002 2:59 pm
by hob_goblin
Do you just try to find something to say in every topic? your name was like all the way down the page...
Posted: Sat Aug 24, 2002 3:07 pm
by Xelmepa
Pocketx, if you don't know PHP at all, you could as well download a ready script from a big script site. Just search @ google.
Posted: Sat Aug 24, 2002 3:58 pm
by Takuma
hob_goblin wrote:Do you just try to find something to say in every topic? your name was like all the way down the page...
No, I'm not... I'm just commenting on people and also helping poeple (not always though...)