Re: How to handle actions that may take a long time?
| From: | listas@uakari.com | Date: | Tue, 01 Mar 2005 08:14:39 +0000 |
| Subject: | Re: How to handle actions that may take a long time? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209669@lists.php.net to get a copy of this message | ||
You can send a piece of HTML defining some little thing like a div layer
with your "please wait, bla bla bla...."
So the visitor can read something.
When the process is finished, you can write another piece of HTML
containing some JavaScript lines, changing the text (and icons or
images) so you can inform your visitor that the process had finished.
This is the clasical no end web page... You can do something similar
with frames, so in a little frame the visitor can see the status,
(searching, wait...) and in another big frame can do something usefull.
Devta
Richard Lynch escribió:
>Cajus Pollmeier wrote:
>
>
>>I'd like to know your opinion about how to handle events that may take
>>more than a minute to finish in PHP. In this case, the code is
>>performing a recursive action on a large LDAP tree where I'd like to
>>present something like a status page ("Please wait, blah blah" with
>>some animated gif or so), while the action takes place in background.
>>
>>Is it possible to fork away this PHP code and set some SESSION vars to
>>trigger the end of the status page? Or do I have to put this action
>>behind a one pixel image and act when the page is "really" complete?
>>Also I'm not sure how to handle the script execution timeout problem...
>>
>>
>
>Do you really expect the user wants to sit there for all the time waiting
>for the process to finish?
>
>Is there ANY way to factor out that code and do it before they get there?
>Obviously not for a search where the user types in what they want, but is
>that what you are doing? You don't say; I can't guess.
>
>Basically, if I have to sit there waiting, then I'm not really all that
>impressed with an animated gif or whatever...
>
>Perhaps you have them logged in already, and you could record their search
>parameters and assign it an ID, and perform the search in the background,
>and then have a page to deliver the results to later.
>
>In other words, let me start up a couple searches, go do something else,
>and come back later for my answers if I can't have them RIGHT NOW.
>
>The web is all about RIGHT NOW :-)
>
>There are a lot of possible answers, really, but unless you provide
>context for the rest of your application and how the LDAP search fits in,
>we can't give you much.
>
>
>