HTML, Ajax, JavaScript... question

In order to accurately track actual downloads you will have to implement something very simple on the server - some script that just reads a value in a file and increments it. Later display that value by using SSI (server side includes) in your html or use AJAX to load it and place it somewhere on the page.
The setup will be something like that:
in the html have a link to the download

<a href="http://server.com/file.zip" id="myDownloadLink">Download file.zip</a>

<p>This file has been downloaded so many times: <span id="myDownloadLinkCounter"></span></p>

<script>
//this is jQuery code that will perform an ajax request to the server
$( function() {



$.ajax( {
   type: "GET",
   url: "theydownloadmyfile.php",
   data: "filename=file.zip",
   success: function(msg){
      $( '#myDownloadLinkCounter' ).text( msg );
   }
} );


$( '#myDownloadLink' ).click( function()
{
$.ajax( {
type: "POST",
   url: "theydownloadmyfile.php",
   data: "filename=file.zip",
   success: function(msg){
   }
} );
return true;
} )
} );
</script>

If it is possible to implement any server side script this will work. I can provide the php for that. If not, than it's irrelevant, but you still can use some of the jQuery code.