954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to detect online visitors and members??

At any forum , you can see if a specific member is online or offline, or generally , how can I detect online visitors accurately who are visiting my website at the moment ...

Thanks in advance

quecoder
Newbie Poster
12 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

That is typically done by logging the time when a given user (or a guest, if you want that) was last seen.
Once a user hasn't been seen for some predetermined amount of time, he is considered off line.

This is really the only reliable method, given the stateless nature of the web.

Atli
Posting Pro
540 posts since May 2007
Reputation Points: 93
Solved Threads: 70
 

Have a look at http://www.hscripts.com/scripts/php/usersOnline.php and play about with that code.
Regards,
Sam Rudge

samarudge
Posting Whiz
359 posts since May 2008
Reputation Points: 26
Solved Threads: 31
 
Have a look at http://www.hscripts.com/scripts/php/usersOnline.php and play about with that code. Regards, Sam Rudge


This was actually the script I was going to suggest. You could implement it with your current system and possibly identify the IP addresses by the IP addresses your users logged in with. Just a thought.

MVied
Junior Poster
112 posts since Aug 2008
Reputation Points: 21
Solved Threads: 11
 

I think you can done this idea by session (for members)

like if session user is available so the user is here

The-Marshal
Newbie Poster
1 post since May 2011
Reputation Points: 10
Solved Threads: 0
 

IP address is unreliable.
DB sessions could be a way to go, although last_impression timestamp for logged on users can be used as a cut-down version. You need a clean up with these though (php script or MySQL trigger), unless you run a cron job every 20 minutes or so.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You