Re: pulling script in interval of second.

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

 



On 01 Jul 2014 at 21:31, hadi <almarzuki2011@xxxxxxxxxxx> wrote: 

> I already tried onbeforeunload and unload event. But the problem when user
> change the page or navigate to different page code will be executed.

In your onbeforeunload event handler, you should make a synchronous ajax request to your PHP script (or another script). If you do an asynchronous ajax request, the page unloads and apache will kill the PHP script. With a synchronous request, the page stays until the PHP script completes.

--
Cheers  --  Tim

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