A simple google search of “download tracker” yields 92,900,000 results. There are also a lot of nice download tracking script that i know. They all come in useful when you have a lot of files for download and you have your own download repository of large number of files, like on my other Free Webmaster Resources website (though i use a custom coded one there). But on this blog, i just have some 2-3 themes and 1 plugin for download as of now. So, a download tracker would simple be unnecessary. But, i would like to track how many times my file have been downloaded. I use a simple method here on my blog.
I have a PHP file with the following code :
<?php
$hits = file_get_contents("SOME-NAME.txt");
$hits = $hits + 1;
$handle = fopen("SOME-NAME.txt", "w");
fwrite($handle, $hits);
fclose($handle);
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=LINK-TO-ORIGINAL-ZIP-FILE" />';
?>
The SOME-NAME.txt is the text file to which the number of downloads is written. It needs to be CHMODed to 777. And initially, it should contain “0″ as the file content. The LINK-TO-ORIGINAL-ZIP-FILE is the link to the file that needs to be downloaded. It can be any type, not necessarily be a Zip file.
I currently use this method for all my downloads on this blog. For eg, Got Banners can be downloaded from Here. The tracking is done on this TEXT File. Now, i hope that helped some of you.






