Hi i often write pages that show result as the calculation goes things like .. for ($i=1; $i<100; $i++) { // Do a heavy job which may take some seconds echo time("H:i:s") . "<br>"; } PHP: sometimes when i call this page - it starts loading as execution goes (slowly trowing the results on in my browser), and sometimes it just waits for like 5 minute and then just kicks all the result on my screen at once .. and i have no idea why is it so .. i use the same browser on the same machine, still the way of output differs .. so .. how can i make my browser to show the results as soon as the server send them, and not wait for the server to send the whole page and then throw the whole thing on my screen at once for example, if my script does an echo every 2 second, i want that result to appear in my browser every 2 seconds .. and not my browser to wait for 200 seconds and then throw the whole thing on screen any idea ?
http://www.php.net/flush Past that, some browsers handle display diferently than others. For isntance Opera allows visitors to set the redraw time to "instantly" or "x seconds" and there's nothing you as a programmer can do to affect that. It exists to let the visitor restrict the processing power the browser uses to refresh the display. I believe Firefox has a similar setting with the default being about a second.
Yep. Browsers are not actually made to handle scripts that take minutes to do something and give you updates every now and then. If it's only for you, you could make a logfile that shows you what it's doing