Php download on the same page without redirecting -


i have question

how can make sure when android apk file download trigger, index.php page remain without being redirected blank.

index.php page  <head>     //the javascript loading progress bar fake simulation how kb left.         <script>             $(document).ready(function() {                 $('body').on('click', '.btn', function(event) {                      $('#init').hide();                     $('#progress').show();                     progress_bar(3210, 'kb');                 });          });     </script> </head>  <body> <a href="download.php?appid=100&sid=12345" class="btn">download & install</a> </body>    download.php  $appid= $_request['appid']; $sid= $_request['sid'];  if($appid==100)//offer download url {     $url= "http://yeahmobi.go2cloud.org/aff_c?offer_id=20374&aff_id=18009&aff_sub=".$sid;      header("location: ". $url);     exit();  }  if($appid==111)//offer download url {     $url= "url-to-download-that-go-through-double-meta-refresh";      header("location: ". $url);     exit();  } 

when click download link, chrome auto download @ same page, firefox redirect blank page dialog popup appear asking whether download.

i looking make index.php remain intact, animation simulation download can show user, while download triggered.

any idea guys?

call download.php file ajax request. catch event jquery , call:

$(document).on("click", ".btn", function(e){      e.preventdefault();      //ajax request }); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -