Re: After browser quit



Martie Krukkeland wrote:
I think the mentiond function is a PHP functions wich has to run when the PHP-code ends.
At this point the page is sent to the browser. PHP does not have any clue what the user is doing after the page has been sent to the user/browser. PHP cannot see if the user is closing his browser or thatelse the usr is doing. PHP only knows about the user again when the user click's on a button or URL-link en the PHP-code is started once again.

But if the user close the page the PHP-code is not addressed. to force the brower to do someting when the user closes a page, you must use someting link the (body) "onclose" (or something like that) JavaScript function.
When the user closes a page (or browser??) the JavaScript can then execute the final PHP code to do the clean-up.

Or i just did completely mis-understood youre Question:
--------Is it possible to run some code after the user closes his browser?
--------I want my script to kill some processes when a users stops his browser.


"Wouter van Eekelen" <woeterman@xxxxxxxxx> schreef in bericht news:3518$4a99aabd$546958b5$29116@xxxxxxxxxxxxxxxxxxxxxxxxx
After a little search it seems to be possible to do that within php, see:

http://nl.php.net/manual/en/function.register-shutdown-function.php

This will call a function when the browser is stopped. Exactly what I needed! :) Thanks for your repsonse.

"Martie Krukkeland" <m.krukkeland op upcmail punt nl> wrote in message news:921a0$4a994afb$4dfb89bf$1074@xxxxxxxxxxxxxxxxx
I think only JavaScript can do that. JavaScript in turn can than do the load of the final php code??
Maybe the "onclose" eg. event in the JavaScript could do the trick (there is an OnLoad event, but is there an OnClose event)??

"Wouter van Eekelen" <woeterman@xxxxxxxxx> schreef in bericht news:1a1c2$4a9941f9$546958b5$18577@xxxxxxxxxxxxxxxxxxxxxxxxx
Is it possible to run some code after the user closes his browser?
I want my script to kill some processes when a users stops his browser.

Thanks.






You are talking about processes.
PHP has no access to the users OS.
Only javascript it able to interact with the users environment.
Is this what you were talking about?
.


Loading