May be this is already discussed here. but i didn't get anything related to it though(solved one). so sorry if this would become repetitive thread.
I want to show user's status online or offline. so i have created one status column into my database. if user is login change the status to 1. till here i am done. but how can i update that 1 to 0 while i ll logged out.
because in my logout.php, only following code is there
if we are able to do this. then there is one more issue will be remaining.PHP Code:
$retval = retpath();
$userid = $_SESSION['userid'];
$login_date = date('Y-m-d');
$user_filename = "log_files/user-".$userid.".log";
//this is something i want to do
$update = $op->runsql("UPDATE ".tbl_author." SET status = 0 WHERE id = '$userid'");
what if user wont do log out and just close the browser as it is then how come my status column would be updated?
please suggest me something.
thanks in advance.