http://www.johnboy.com/php-upload-progress-bar/
It uses the ob_flush() and flush() functions of PHP. From what I've read, these functions have no effect if mod_gzip is enabled in your apache server. I'm on a shared hosting plan with Dreamhost and they have mod_gzip enabled, but you can request to have it turned off for certain subdomains. I did so, but it seems that it didn't have an effect. Here is my code:
Expand|Select|Wrap|Line Numbers
- <?php
- ob_start();
- for ($i = 0; $i < 5; $i++) {
- echo $i . "<br>";
- ob_end_flush();
- ob_flush();
- flush();
- sleep(1);
- ob_start();
- }
- ob_end_flush();
- ?>
I need to know how to make this work. I have a script that can take 30-45 seconds to run and I want something for my users to look at. Using Flash really isn't an option because I don't know flash. I COULD use AJAX and simply send a request to another script, but I'd like to try to avoid anything that requires Javascript.
Please, if you guys could help me out, I'd be super grateful!