kellz Posted November 13, 2007 Share Posted November 13, 2007 How would i know how many users are logged in to their profile? i have a login script and when they login they get to their profile, but at the home page i want the visitors to know how many people are currently active.. Quote Link to comment Share on other sites More sharing options...
recklessgeneral Posted November 13, 2007 Share Posted November 13, 2007 Hi, This tutorial looks like it might be useful: http://www.phpfreaks.com/tutorials/62/0.php Cheers, Darren. Quote Link to comment Share on other sites More sharing options...
kratsg Posted November 13, 2007 Share Posted November 13, 2007 Here's how. Get the current timestamp [time()] for the user when they load the profile page. Insert this current timestamp into the database (in the users table I hope) Do a mysql_query() where the the current timestamp minus the timestamp in the database is less than a certain amount of time (this gets all users active in this certain amount of time). Display the results, done. Quote Link to comment Share on other sites More sharing options...
kellz Posted November 13, 2007 Author Share Posted November 13, 2007 okies.. thx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.