A way (though there may be others) is to use AJAX, and ob_flush
. With AJAX, people normally wait for the page to totally done processing (response code 4 I think) but if you start looking at the response before it is complete (3 i think) then you can display information about what is occurring on the server side while
A crappier way of doing this would be to load a page that makes it look
likes its doing step 1, step 2, etc. but really has already run the script. (If you want to do this, but don't want to wait for the script to finish first, use register_shutdown_function
.) Though never the best idea, this can come in handy for cases when (for whatever reason) your users feel like they need to see something happening.
(For instance, I have an AJAX save button on one of my web applications. My users kept clicking them over and over again because they thought that it was saying "Saved" too quickly to have actually saved, so I added a delay to it. Same type of idea here. Again, not the ideal way to go.)