Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Creating download counter

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

Junior Member

5+ Year Member

joined:Feb 3, 2011
posts: 58
votes: 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.
9:25 pm on Feb 17, 2011 (gmt 0)

New User

5+ Year Member

joined:Feb 17, 2011
votes: 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