How to understand closed window
<p>I have created a chatroom.php and i made target="_blank" that directs the user to the appropriate room whenever a user clicks a room's link. Also, when a user clicks that link i stores the nickname of the user in database, to display the nicknames of the users in that room. However, when a user closes a room's window it still displays that user is online which is not wanted. I need a way that whenever a user closes a room such as chatroom?name=book, i will delete him/her from that room. I hope i made myself clear. It should work like logout.php for certain room. How can i do that?</p>

<p>Thanks</p>
