In addition to disabling output buffering ($|++;), you may find that some browsers don't display the page until the script has completed. In addition, you may find that some browsers do display the partial page as it is generated but a timeout occurs before the script has completed. In these cases, a solution based on this article by merlyn may be helpful.