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
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.

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.