I need help on counting download link


I need help on Counting download link just like CC Hub community count link clicked share on their site. here is ma download link inside a bootstrap btn
a href="<?php echo $song ?>" target="_blank" class=“btn btn-danger” ">Download</a

I want to count number of times each song is download.
Please anyone help me out. :pensive::sweat:


How is the download handled, javascript, html5 or php


its a PHP script a href="<?php echo $song ?>" target="_blank" class=“btn btn-danger” ">Download</a


the $song variable, is it the link to the file ?


yea . . ijust got a perfect solution to it now . . thanks for your swift response. i created a file download.php.

<?php $userid = $_GET['id']; $result = mysql_query("SELECT * FROM ads WHERE ads_id='$userid'"); while($row1 = mysql_fetch_array($result)) { extract($row1); $log = $row1['download']+1; $sql="UPDATE ads SET download='".$log."' WHERE ads_id='$userid'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } header("location: index.php"); exit(); } ?>

and i use i button to open both download link and download.php . . and it work jsut too perfect


cool! just what i had in mind, happy hacking :thumbsup:


Thanks Boss . . u ar the best .