2

I have a php script it will echo message as "job started" after 60 seconds it will echo back one more message as "job completed". If i run the script in google chrome it will echo first message after 60 seconds it will echo second message. The same script if i run in IE it will echo both messages at a time after 60 seconds. So could anyone please help me to solve this?

I hope information is clear.

Mahadeva
  • 37
  • 3

2 Answers2

1

Php is server sided, so the server process your script when its done, it will send back html. IE has noting to do with your php file.

Use Javascript Because this is client side.

Alireza Fallah
  • 4,609
  • 3
  • 31
  • 57
KBeckers
  • 416
  • 4
  • 12
0

IE needs more data to start rendering than just a few characters. Generate a large ammount of whitespace before flushing and starting your sleep.

From the PHP manual: http://dk1.php.net/flush

"flush() may not be able to override the buffering scheme of your web server and it has no effect on any client-side buffering in the browser. It also doesn't affect PHP's userspace output buffering mechanism. This means you will have to call both ob_flush() and flush() to flush the ob output buffers if you are using those."

"Some versions of Microsoft Internet Explorer will only start to display the page after they have received 256 bytes of output, so you may need to send extra whitespace before flushing to get those browsers to display the page."

Jervelund
  • 617
  • 7
  • 13