How to attach download counter to download button?
<p>I have 6 download buttons in a page for 6 different files. I want download counters for each of them. And the "NO OF TIMES DOWNLOADED:" for each file to be displayed under each file's picture on the webpage. 
<a href="http://www.aamaodisha.org/secdownload.html" rel="nofollow">http://www.aamaodisha.org/secdownload.html</a></p>

<p>I just amn't being able to move any further ahead. 
I have very limited knowledge about PHP but after searching a lot on Google, I stumbled upon a code for counting the no. of downloads:</p>

<pre><code>&lt;?php

$num= intval(file_get_contents('counter.txt'));
$num+=1;
file_put_contents('counter.txt', $num);

echo "No of times downloaded " . $num ." ". ;
?&gt;
</code></pre>

<p>To see for myself, how it functions, I saved this php as downloadcounter.php and placed it in the download directory of my webhost where my original files to be downloaded are located. I also changed the download link to 
<code>&lt;a href="Magazine/downloadcounter.php?number=1&amp;file=9thEdition.rar&gt;Download&lt;/a&gt;</code> in my HTML for the first download button. 
I also placed a counter.txt file in the same download directory with initial value as 0 (i.e the notepad file named COUNTER.TXT has only 0 written).</p>

<p>But when I click my download button, though the file starts downloading (which means that I have successfully linked my download through the php file (downloadcounter.php)
But when I look into the counter.txt after each download, I still see 0</p>

<p>Can you please guide me as to how to show the number of downloads on my webpage under the DOWNLOAD button, the way i have planned as this <a href="http://www.aamaodisha.org/secdownload.html" rel="nofollow">http://www.aamaodisha.org/secdownload.html</a>
On this HTML page, I have simply written the number of downloads, but they aren't the actual automatic counter generated data :( 
Can someone show me the way out? I have been stuck here on these download counter designs since two days. (I sincerely apologise for my limited knwoledge about PHP or other languages)</p>

<p>Thanks in advance</p>
