Jump to content

Recommended Posts

To describe the problem more furtherly I designed a chatroom, and when the user logs to the chatroom he is added in a users list using this command:

 



if(session_is_registered("user_name")){

$chat_user=$user_name;
session_register("chat_user"); 

   $sql="INSERT INTO current_chatters  VALUES('0','$chat_user')";
   $result=mysql_query($sql);
}

 

Now when the user wants to logout he is supposed to click on an exit button

which will direct him to page logout.php;

In this page i can end his session and delete his name from table current_chatters :

 

page logout.php:

session_unregister("chat_user");

$query = "delete from current_chatters where chatter='$chat_user'"; 
$result = mysql_query($query);

 

But imagine if he closes the browser? how can I delete his name from table current_chatters?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.