jwk811 Posted February 22, 2007 Share Posted February 22, 2007 like this site does, how can i show whos active including people who are registers with thier usernames and the guests...? Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/ Share on other sites More sharing options...
JasonO Posted February 22, 2007 Share Posted February 22, 2007 This is forum software and is built into it. Are you trying to do this with your website or are you using some CMS or Forum software. Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/#findComment-191581 Share on other sites More sharing options...
jcbarr Posted February 22, 2007 Share Posted February 22, 2007 In a regular site what you would do is generate a session for each user when the log in. Then insert that in to a table called something like active_users. You would then query that table and display the information on the site somewhere. When the user logs out, you have the script delete their information from the active_users table. That is a very basic idea of what you have to do, but it should lead you in the right direction. Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/#findComment-191582 Share on other sites More sharing options...
jwk811 Posted February 23, 2007 Author Share Posted February 23, 2007 yeah but on this site you dont have to login and out all the time but it still shows whos on.. b/c it saves your username and pass on a cookie.. so how do they know if you're just looking? anyone? Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/#findComment-191942 Share on other sites More sharing options...
redarrow Posted February 23, 2007 Share Posted February 23, 2007 exspire the cookie via the time function here an example from php.net ok. <?php $value = 'something from somewhere'; setcookie("TestCookie", $value); setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */ setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1); ?> Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/#findComment-192002 Share on other sites More sharing options...
jwk811 Posted February 23, 2007 Author Share Posted February 23, 2007 but i thought they have it certain who was viewing the forum at that exact time.... Link to comment https://forums.phpfreaks.com/topic/39686-active-users-and-guests/#findComment-192271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.