RE: [PHP] Screen Refresh (possible?)
| From: | Lawrence dot Sheed at dfait-maeci dot gc dot ca | Date: | Thu, 28 Sep 2000 01:25:39 +0000 |
| Subject: | RE: [PHP] Screen Refresh (possible?) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17835@lists.php.net to get a copy of this message | ||
1) Don't use echo - use print
2) flush()
You may have to do a useless system call to output something before the
flush, before the browser see's anything, here's what I use:
print "...";
System("echo ''");
flush;
Also have a look at the php comments on flush();
cheers,
Loz.
-----Original Message-----
From: Toby Miller [mailto:tmiller@creativegeneration.com]
Sent: September 27, 2000 01:12 AM
To: php-general@lists.php.net
Subject: [PHP] Screen Refresh (possible?)
Hey all,
I've run across a situation that doesn't seem to have a resolution. I hope
I'm wrong about that.
If I have a memory/cpu intensive process running in one of my scripts
(intensive enough to keep calling set_time_limit to keep it going) then I am
unable to print results/updates to the screen during the process. I have
tried this with no success. Any ouput I attempt to push to the screen
doesn't show up until the process is complete.
What I'm actually doing is checking an email pop account. I would like to
send a javascript call after every message downloaded (in another frame) to
update a progress counter to let the user know what's going on. Without this
ability a lot of users may think the script is failing or stalled and hit
cancel or reload.
The only point of reference I can come up with is writing a windows app in
Visual Basic. You can cause a form to refresh during a process like this
which will correctly update the form. Does anyone know of any way to get the
same result in PHP for the browser?
Thanks in advance,
Toby