Re: Execute a php page and don't wait for it to finish

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

 



On Tue, 2010-10-19 at 18:50 +0530, Ferdi wrote:
> Hi List,
> 
> I have a php page that updates data from one database to another when it is
> run.
> My query is, how can I trigger the execution of this update page from
> another php / javascript without the calling page having to wait for the
> update page to finish?
> Basically, I think the update page needs to use:
> ignore_user_abort(1);
> set_time_limit(0); // I don't think the script will take more than 1 min.
> 
> At the other end I found this:
> 1)
> http://www.mindraven.com/blog/php/run-a-php-script-in-the-background-using-ajax/
> 2) On that page a user suggested using *pclose(popen(â/usr/bin/php
> /path/to/something.php > /dev/null &â, ârâ)*
> *    *However, I need this to be usable on windows servers also.
> 3) Finally, would pcntl_exec, pcntl_fork, exec or something be useful for
> me?
> 
> Which of the above 3 options is the better one?
> Other suggestions are welcome :)
> 
> Thanks and Regards,
> Ferdi

Ferdi:

check out: http://us3.php.net/manual/en/function.ignore-user-abort.php

I am looking to change a script/app that i have to use this (as the
script takes a few seconds to finish, and there are people hitting the
back button, or soemthign else that is screwing the submission.   I
haven't implemented it (life has been busy) yet, but it seems to be what
I was looking for, which may be what you're looking for... 

Steve.


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