Thanks Tedd,

ajax works fine now,when submiting a button it will show the number and it
doesn't have any problem

$(function() {

 var id=$(this).attr('id');
 var dataString = 'id='+ id ;
   type: "POST",
   url: "download_number.php",
   data: dataString,
   cache: false,
   success: function(html)
  }  });


<input type = "button" value="Download" class="button" id="<?php echo $id;
?>" >


<div id="div_<?php echo $id; ?>" ><?php echo $downloadcount;?></div>

by the way* I totally will refuse this approach* because,although the ajax
is working,but I can't do anything for click to download the related file
because when I go to my php page I can't redirect it to a page for download
and besides echo the output to be written in div element,so that,the best
solution is just redirect to a page and download the file in first place.
after submiting write a $_POST['submit'] and just store the download
count,update the table and if user refreshed the page,can see the number of
downloads,*as sure there isn't anything better than this.*

Marco suggested me iframe,reloading it,like a manual ajax but I think it
has much of troubles.

by the way thanks for all helps.

Reply via email to