Can you help me with this PHP problem?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Michal00
Forum Newbie
Posts: 3
Joined: Fri Apr 06, 2012 2:47 am

Can you help me with this PHP problem?

Post by Michal00 »

Hi I developed a website and i also create login session in my website by using PHP and MySQL... but now i want to know that how can i add a feature which will print "online" if that user is online or print "offline" if that user is offline....Please help me.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Can you help me with this PHP problem?

Post by Celauran »

Are you storing user sessions in the database?
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: Can you help me with this PHP problem?

Post by x_mutatis_mutandis_x »

Need not store the sessions per say, but just the sessionId. Use that to track the login activity in a table
Following could be your columns in the table:
session_id
login_date
logout_date
username
ip_address
Post Reply