Re: How to handle actions that may take a long time?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

  

No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.2 - Release Date: 28/02/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux