Mod-Jay Posted September 14, 2010 Share Posted September 14, 2010 Hi! i need a PHP code, i know this is for help but i cant figure out what to do.. Please help.. This code i need is to tell if a user is logged in or not. i use sessions. and i need it individual. Please help... If not ill keep trying.. you could atleast come up with something to work with.. if u need anything ask.. like for my login data or anything Link to comment https://forums.phpfreaks.com/topic/213345-need-a-php-code-clueless/ Share on other sites More sharing options...
Mod-Jay Posted September 14, 2010 Author Share Posted September 14, 2010 Please Help... Link to comment https://forums.phpfreaks.com/topic/213345-need-a-php-code-clueless/#findComment-1110806 Share on other sites More sharing options...
gamesmstr Posted September 14, 2010 Share Posted September 14, 2010 Ok, you are using sessions. Are you using any kind of database? If so, store the session data in the database and have it update whenever someone logs in. Then you can pull that data whenever you like and see if the session has expired on the server or not. Another way of doing it is assign a lastactive column to your user table in your database that updates every time a user loads a page. You can then check the last time he was active. If it is longer than your sessions expire then he's offline. Link to comment https://forums.phpfreaks.com/topic/213345-need-a-php-code-clueless/#findComment-1110812 Share on other sites More sharing options...
plznty Posted September 14, 2010 Share Posted September 14, 2010 I'm pretty sure no ones going to create code for someone when they don't know how your system works. This section of the forum is to help with faulty code whether it be logical error etc. I think AJAX is needed to log for exact users online otherwise your going to need to have users within the last X amount of time. Link to comment https://forums.phpfreaks.com/topic/213345-need-a-php-code-clueless/#findComment-1110844 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.