Jump to content

Need A PHP Code.. [Clueless]


Mod-Jay

Recommended Posts

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

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.