>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?
I thought you might place the flush() in a while() loop, and keep outputting whitespace until you cross whatever buffering limit the server imposes, but of course this won't work since you can't send output before the Location: header. That's probably the source of the problem you have - with nothing to flush, flush() won't work. Two options I immediately thought of to drop into the background: start a command line php process, using exec() or the like with the usual '&' at the end to drop into the background -- I see Rich has just suggested this. If you want to avoid the database route, use a filesytem queue to signal cron on its next run. Tell the user that "their request will be handled in the order in which it was received" and then cron can check a file or directory for new requests, and process them. I don't think the minute delay is an issue, because the whole thing takes an hour, so what's a minute or two here or there? Jus let the user know they're in good hands and get to it when you get to it. --------------------------------------------------------------------- michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php