Page is a not externally linkable
rocknbil - 4:25 pm on Mar 9, 2009 (gmt 0)
So if you could initiate the process, then return an immediate response to the browser, the child process would continue in the background. You'd need another tool to check the progress of the child. $pid=process ID. ## First you submit and return an immediate The previous is a perl approach (close(),waitpid()) but it would be very easy to emulate this in PHP.
Well, you could try forking the process. Part of the problem in a large or lengthy process is it has to maintain a connection with the browser.
## response. Do not exit after the response.
&html('Checking the data');
## This is the parent, which just marks the progress
if ($pid = fork) {
&mark_progress($pid,'current_process');
}
## This is the child. You want to close STDOUT so the
## call to your HTML sub above doesn't "hang."
else {
close (STDOUT);
&do_your_large_process();
}
## So the parent doesn't kill the child
waitpid($pid,0);