Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

USER ONLINE/OFFLINE script for social network project

How to check is user online or offline in php ?

2 Answers

Store values into a database every time the user makes a change / loads a website etc. Use this date/time value to see if the user is currently online. If currenttime - lastChange is greater than 5 then the user is offline. Else, he should be online as he has made changes in the past 5 minutes.

What exactly are you looking for? A login script?

I am looking for a script which can show other users who is active like facebook online feature.Not same as facebook but something like that.