Forum Moderators: coopster

Message Too Old, No Replies

Tracking online users at my site

How can I get the user's ip address?

         

satishpalasa

11:08 am on Apr 9, 2007 (gmt 0)

10+ Year Member



how can we know online members using php

eelixduppy

11:21 am on Apr 9, 2007 (gmt 0)



Welcome to WebmasterWorld! :)

>> How can I get the user's ip address?

You could use $_SERVER [us2.php.net]['REMOTE_ADDR']

[edited by: eelixduppy at 9:47 pm (utc) on April 9, 2007]

satishpalasa

12:00 pm on Apr 9, 2007 (gmt 0)

10+ Year Member



thank you for ur response
with the given code i am getting all the ip address but how can i knew whether the user is in online or not

eelixduppy

8:38 pm on Apr 9, 2007 (gmt 0)



There are a few classes that will achieve what you want. Take a look at phpclasses [google.com] for a few. You may also want to check hotscripts.com or sourceforge.net as they may have something that interests you, as well.

Good luck! :)

bysonary

9:20 pm on Apr 9, 2007 (gmt 0)

10+ Year Member



Why would you do it by IP address? couldnt you use cookies or something, only problem is if someone goes offline then comes back online day or two later their ISP may have provided them with a new IP address in which case you will never be able to know if they are online because you will have logged their old IP address.

I am of course assuming you are wanting to check to see if a user is logged into a particular system in which case you could just log their ip address as they login and that way you will always know their current ip address and that way it makes my above comment null and void.... thats probably what you meant, sorry