943,955 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1844
  • PHP RSS
Sep 12th, 2008
0

how to detect online visitors and members??

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
quecoder is offline Offline
12 posts
since Mar 2008
Sep 12th, 2008
0

Re: how to detect online visitors and members??

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.
Reputation Points: 93
Solved Threads: 70
Posting Pro
Atli is offline Offline
526 posts
since May 2007
Sep 15th, 2008
0

Re: how to detect online visitors and members??

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

Re: how to detect online visitors and members??

Click to Expand / Collapse  Quote originally posted by samarudge ...
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.
Reputation Points: 21
Solved Threads: 11
Junior Poster
MVied is offline Offline
111 posts
since Aug 2008
May 31st, 2011
-1
Re: how to detect online visitors and members??
I think you can done this idea by session (for members)

like if session user is available so the user is here
Reputation Points: 10
Solved Threads: 0
Newbie Poster
The-Marshal is offline Offline
1 posts
since May 2011
Jun 1st, 2011
0
Re: how to detect online visitors and members??
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.
Sponsor
Featured Poster
Reputation Points: 1048
Solved Threads: 949
Sarcastic Poster
ardav is offline Offline
6,698 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: iframe pulling in php giving me problems out of the blue
Next Thread in PHP Forum Timeline: Open page in a frame





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC