The user fills in a form on a page and submits it. My script processes the data, then redisplays the page with success or error messages, and the user can correct the data or fill in new data if it was successful. Pretty straightforward.
However, the processing that I'm doing in PHP can take more than a few seconds, as for example it might involve sending out several email messages. What I'm looking for is a way to display a page (or part of my existing page) with an animated GIF that will just let the user know that things are working (a fake progess bar). Then, when the script's work is done, the page will redisplay (or continue to display) normally.
I did see one interesting trick for getting this effect, but it would also require some Javascript on the page (basically, replaces the animated GIF image with an empty spacer GIF using the "onLoad" event). Part of the problem is that I'm not sure how much of the page a browser will display if my script has only output part of the page.
Anyway, I'd appreciate any tips. I'm an experience C/C++ developer (which gets me in trouble with PHP occasionally!), and I'm used to being able to have more direct interaction with the user than you can get with this browser-server architecture.
Doug G
How to show "activity indicator" while busy
Moderator: General Moderators
Re: How to show "activity indicator" while busy
Yeah javascript on the client side is really the only way to do it. If you have problems with the page partially loading you can play around with the output buffering settings in php.ini or use the ob_start() function and friends.