- Joined
- Oct 28, 2010
- Messages
- 888
- Reaction score
- 115
Hi guys, I've been making a website in PHP, it's fully functional and I've got the majority of it working.
I have a function for an admin to be able to see what user's are currently browsing the website with their details, again, that works perfectly.
But my problem is, when a user closes the browser, the session is still active and does not set the column where it states the user online to offline.
On my log-out button, I have this php code called:
I want to know how I can end a session and update the user's status column to go to 'N' when the user's session is no-longer active.
Many thanks,
Mathew Clarke
I have a function for an admin to be able to see what user's are currently browsing the website with their details, again, that works perfectly.
But my problem is, when a user closes the browser, the session is still active and does not set the column where it states the user online to offline.
On my log-out button, I have this php code called:
PHP:
if(isset($_GET['logout'])) {
mysql_query("UPDATE members SET status='N' WHERE mem_user='".$_SESSION['user']."'");
session_destroy();
echo '<meta http-equiv="refresh" content="1; url=index.php">';
}
I want to know how I can end a session and update the user's status column to go to 'N' when the user's session is no-longer active.
Many thanks,
Mathew Clarke

