Bloodrun Posted May 26, 2009 Share Posted May 26, 2009 Alright, well I am creating a forum. And one of the things I would like to get settled, is a offline/online script. Now I have an extremely basic set up for a offline/online function, the problem is, that it's so basic, it sometimes doesn't work. The way I have it that when someone logs in, it inserts into a mysql database that they are logged in. The problem with this is, that if they don't log out, it will continue saying they are logged in, and vice versa. Now, I know I can fix that with a simple timeout code (which I dont know how to write..) The other thing I would like to do, is make a "Whose online" option, and I know that requires the users IP address, I believe, which again is something I don't know how to do, or don't know what to piece together in order to do it. Can you give me some pointers? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted May 26, 2009 Share Posted May 26, 2009 The general approach is to store a timestamp of their last activity. Obviously this has to be done on every page they visit. The users who are online are then those who have been active inside the last x minutes. Quote Link to comment Share on other sites More sharing options...
kickstart Posted May 26, 2009 Share Posted May 26, 2009 Hi This thread is still going through on this point:- http://www.phpfreaks.com/forums/index.php/topic,253569.0.html Should give you a few pointers. All the best Keith 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.