so I have tried Show results while script is still executing
but for some reason it doesnt work, so here is what I have so far :
ob_start();
include "../../common.php";
set_time_limit (0);
$start = (string) $_GET['start'];
$end = (string) $_GET['end'];
for($i = $start; strcmp($i, $end); $i = bcadd($i, 1)){
echo $i;
ob_flush();
}
ob_end_flush();
UPDATED CODE
*note that this code doesnt work yet!
set_time_limit(0);
$start = $_GET['start'];
$end = $_GET['end'];
for(;$start < $end;$start++){
$content = file_get_contents("[some internal page]");
echo $content;
usleep(10);
flush();
}
Try adding a call to
flush()after the call toob_flush(). This will only work if your server is configured to be able to do it, and does not guarantee that the client will handle it sensibly, but it is your best bet.One sticking point I have come across here is that is you have zlib.output_compression configured you absolutely cannot do this, full stop. The zlib output compression process is started before any of your code is executed and cannot be controlled by your script at run time with
ini_set()and the like.