Forum Moderators: coopster

Message Too Old, No Replies

Script that take long time to complete

how to display text to browser more often?

         

AthlonInside

3:47 am on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am writing a script that take minutes to complete because it fetched pages from the web.

I want to write it in a way that for each URL fetch, there will be a message displayed in the browser containing the STaTuS.

The script do works in the terms of fetching pages but it failed to display the messages in REAL-time. That means messages are display once a while in a BLOCK. It means 20 status came out at the same time instead of 1 a time.

I hope you can understand what I say. How can I force the browser to display every status immediately instead of waiting for a chuck/block?

MonkeeSage

3:58 am on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is probably a better way (I'm rather new to PHP myself), but I think the [flush() [php.net]] method will do it...just call it as often as you need to flush the output buffer.

Jordan

AthlonInside

6:10 am on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jordan,

That's exactly what i need! Thanks. :)

isorg

2:09 pm on Oct 17, 2003 (gmt 0)

10+ Year Member



BTW, to save you scratching your head when flush() does not work, just remember that flush() will not work if called from within a TABLE. I don't know why, but that's they way it is. So you must come out of a table, call flush() and then create a new table if need be.

AthlonInside

6:38 am on Oct 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shoudl I call it before I want to echo something or after I echo something?

isorg

9:31 am on Oct 18, 2003 (gmt 0)

10+ Year Member



After.