Re: when does php stop php executing when user clicks stop

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

 



On Fri, December 28, 2007 6:33 pm, Eric Wood wrote:
> If database operations are underway when a user accesses a web page,
> then user clicks stop on the browser, does the php stop immediately
> too?

Maybe.

http://php.net/ignore_user_abort

> I'd rather the php continue behind the scenes to fullfill all the
> actions I need it do to whether the user wants to see if happen or
> not.
>
> Overall I wonder how modphp keeps the code executing even if the
> browser
> drops the connection via stop.
>
> Any insight is greatly appreciated.

If you want to be 100% sure something gets done, then don't do it. :-)

Set up a "task" to be done later, and put that in the DB, and then
have a cron job to run through the "tasks" and do them, and mark them
"done" or not.

The fact you are asking indicates that you've got something that takes
too long for a user to wait around anyway, and that's another reason
to just insert a "task" and act on it later.

Don't make a human wait for a slow computer, ever.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
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