zhshero Posted November 17, 2010 Share Posted November 17, 2010 how would i do and offline or online check so if 5 mins has passed it shows the user as offline date('G:ia'); // 0:00am Link to comment https://forums.phpfreaks.com/topic/218910-how-would-i-do/ Share on other sites More sharing options...
zhshero Posted November 17, 2010 Author Share Posted November 17, 2010 nvm i got it if this is how its done $userfinal = get_username($_SESSION['user_id']); $the_time = time(); mysql_query("UPDATE users SET date='$the_time' WHERE Username='$userfinal'")or die(mysql_error()); if (isset($user['date']) && (time() - $user['date'] > 60)) { echo 'offline'; } else { echo "<font color=green>[Online Now!]</font>"; } $user['LAST_ACTIVITY'] = time(); // update last activity time stamp ?> Link to comment https://forums.phpfreaks.com/topic/218910-how-would-i-do/#findComment-1135304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.