Rich,

Thanks for taking the time to respond.  

I do have a database and have considered using it in conjunction with
cron.  However, I don't like the disconnected nature of the solution.
There could be up to a minute delay before cron picks up the request.

There's got to be another method similar to using flush(), that causes
the lengthy processing to immediately start as well as redirecting the
visitor to another page.

Any ideas?

Ron



-----Original Message-----
From: Rich Gray [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 24, 2004 2:38 PM
To: Ron Stagg
Subject: RE: [PHP] Alternatives to Flush()

> I have a particular PHP web page that can take over an hour to
process.
> When visitors come to this page, I want the code to redirect them to a
> separate page at my site.  After the redirection, I want the PHP
script
> to continue operating on its own until the process is complete.
> I am attempting to implement this is by sending a "Location" header to
> the client.  This header is sent out near the top of the script.
After
> sending the header, I call Flush(), then the script continues into the
> heavy lifting. Finally, the script quietly terminates with an exit
call.
> Neither the flush() or ob_flush() calls are working (I even tried
> calling them both).  Regardless of what I do, the server will not send
> the "Location" header until the script has completely terminated.  It
> appears that my hosting provider has Flush() disabled.
>
> I have thought about using Chron to accomplish this.  However, the
> smallest Chron resolution is minutes.  This could cause the visitor to
> wait for up to a minute before Chron wakes up and starts working on
the
> process.

Not sure what you're trying to do here - the web page should just be
responsible for initiating this hour long process right? If you have a
database then can you not create a suitably formatted 'request' in the
db
(then redirect the user if you want). Then when cron wakes up it will
pick
up the request, deletes it and does the grunt work...

HTH
Rich

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

Reply via email to