Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Creating download counter

     

brettxw

6:58 am on Feb 17, 2011 (gmt 0)



Me again! Sorry for all the questions :-/. However, I did some search on this site in regards to creating a download counter for my files. I came across this link :

[webmasterworld.com ]

and since it's quite old, I was wondering what is the process now to have a download counter?

I would like to have all my files that are available to download, to have a count next to the download link to show how many people have downloaded this file (currently)..I would like to implement this for all files that are posted for downloading.

wigpip

9:25 pm on Feb 17, 2011 (gmt 0)






if(isset($_GET['filecounterid'])) {

$idfile = $_GET['filecounterid'];

list($thisincrement) = mysql_fetch_array(mysql_query("SELECT current FROM counter_table..."));

$thisincrement++; // add one here

// then just "UPDATE SET..." the same value in the database

}



include in the download link or could use event like onclick="hitCounter(1001);" and it could be done with an AJAX script counter.

<a href="download.php?filecounterid=1001">download some file here</a>

anyway this method is simple but has worked for me
 

Featured Threads

Hot Threads This Week

Hot Threads This Month