I'm trying to get some data from Ajax request when already PHP running a long script ;
but when the Ajax has been answered that script in PHP is completed, and I need to get Ajax response during running other scripts .
JS
setInterval(function(){
$.post( 'progress.php','',
function(data){
$('.-info-').html(data);
});
},100);
progress.php
session_start();
echo $_SESSION['progress'].'%';
running.php
session_start();
$i=0;
while($i<99){
$i++;
$_SESSION['progress'] = $i;
//sleep(1);
//flush();
}
Is there any way to response when "while"
is running?