the following is what i use to print to the screen, which creates a constant "status" message on my web trawler. Its not an endless loop, just a very long one with a number of parts to it.
function write_status($message) {
$message = str_replace("\n"," ",$message);
$message = str_replace("'","\'",$message);
?>
<script language="javascript">
document.getElementById('barholder').innerHTML = '<font class=qtext><br> <?php echo $message; ?></font>';
</script>
<?php
}
This prints the $message into a table with id= "barholder" when its called at a number of points within the script while the page is loading so the user knows whats going on. flushing isnt the problem, as the PHP script flushes, and this eventually flushes the browser as well, although not sometimes as quickly as i would like.
The browser on "long" trawls, usually after about 15 minutes (approx!) just says "Done" as if the page has finished loading, and then php.exe about 2 minutes later stops as well.
I'ev noticed that some trawlers in PHP have a keep_alive.txt file with a single full-stop in it "." but not sure if this has anything to do with the browser. Its not Apache, and its not PHP either (as no end of script errors) so I can only conclude that it has something to do with the browser time out limit, which isn't affected by the script still writing to it.
Any thoughts ? thanks, and apologies for not being overly clear in previous post.