How to make a "Please Wait..." page while php does something in the background...?
Posted on 2006-04-26
I'm trying to accomplish what I think would be a simple task.
I have a PHP page that runs through quite a few queries and takes a bit to process (20 seconds). I want a page to come up that says "Please wait..." and then at the end of the other PHP that's running it would forward it along to the results page.
I'll use ORBITZ as an example. You enter your data, click SEARCH, it takes a bit. While you're waiting there are ads and a "Searching..." screen. The results are displayed only once it's done processing.
I've tried frames, Header(), Include(), Meta tag refresh etc. You can't put it in the PHP page that does the processing because it won't display anything until PHP is done! (I am on a windows machine as my development machine using PHP 4 and Apache 1.3.x and MySql 4.1).
I've read about using ob_flush and other similar methods, but is that the only option? If so, any examples?