Hi there, below is some code in an iframe which simulates running a process like emailing and updating. It works fine:
if($submode=='sendInvitations'){
echo 'processing started..';
for($i=1; $i<=100000; $i++){
echo '.';
if(!fmod($i,50)){
//update the HTML progress meter every 50 records
echo '<br />';
?><script language="javascript" type="text/javascript">
window.parent.setMeter(<?php echo $i?>,100000);
</script><?php
sleep(1);
}
}
}
Basically, the page continues to flush to the browser, and javascripts each run as they flush out, for a very user-friendly effect.
HOWEVER, and this is my question, I have to do session_start() on this document. But when I do, no output is sent until the page fully loads, basically making the status meter useless.
WHY DOES session_start() BUFFER PAGE OUTPUT LIKE THIS? HOW CAN i CHANGE THIS????
THANKS,
Samuel