Re: flush() problems with IE5
| From: | Johan Hanson | Date: | Tue, 22 Aug 2000 22:33:17 +0000 |
| Subject: | Re: flush() problems with IE5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13182@lists.php.net to get a copy of this message | ||
Kari Asikainen wrote:
>
> The problem is one of my biggest
> scripts which makes thumbnails of images at the server, and I'd like to
> display a "Please wait - don't hit reload or close browser" -window while
> the work is in progress.
Use "ignore_user_abort()" to force processing to continue.
The parameters to that function don't seem to be documented, but I guess
that you could pass anything that is non-null.
That will only make the script run to completion. If you want the user
to wait for an image then use the WIDTH and HEIGHT attributes with
your IMG tags to make the browser view the document before the images
have been loaded.
If you want the user to wait for text, then I suggest that you divide
the script into two:
* Main script, which first outputs a simple "Wait" page in its entirety
and calls ignore_user_abort() before starting the lengthy operation.
The wait page contains HTML that urges the browers to refresh
to the second script with GET parameters with unique info about
the operation.
* Progress script.
Tests if the operation is complete. If so, then output a positive
message, otherwise output HTML that makes the browser refresh to the
$REQUEST_URI.
Hope this helps.
/ Johan
-- johan@tiq.com -- http://www.obsession.se/johan/ --