homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Creating download counter

Msg#: 4268316 posted 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.



Msg#: 4268316 posted 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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved