If an user of my webpage enter to one of my game rooms he will be inserted temporarily into a table named "online" on mysql DB.
When he closes his window, what I am doing is on the unonload event(reload,close or back) I open a new hidden popup window with window.open and on this popup I run my php script to remove this user from "online" table in DB mentioned before.
I really don't like using afterclose popups in order to run a phpscript. So can anyone tell me what can I do to avoid using this popups?
I would like that all the processing even if he closes the window is done in that same window that he's closing. Any other idea(like using java applets windows(this an option but I really don't like it because I don't know any java )) is more than welcome too.
Thanks,
Christian