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 the "online" table 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 is more than welcome too. Any other idea is like using Java applet which I have considered but I don't know any java at all, so I would not like to start learning it.
Thanks,
Christian