obtaining remote address and other info

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
davei234
Forum Newbie
Posts: 1
Joined: Sat Sep 17, 2005 1:21 pm

obtaining remote address and other info

Post by davei234 »

Hi,

I've been trying to find out how to obtain info from the visitor to a website. I've found that using the variable $_SERVER['REMOTE_ADDR'] will get me their ip address, however on some stat sites I see them obtain data as to their location and service provider. Is this done using a secondary search of the ip address? If so, how do you do that?

Thanks,
Dave
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Yes, it is done by doing a search on the IP Address. However, IP addresses are not reliable for this information. it just becomes one big guessing game....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

search around for GeoIP
Simulacra
Forum Newbie
Posts: 7
Joined: Sun Sep 11, 2005 9:25 am

Post by Simulacra »

I'm not to sure, but I think its either

REQUEST_URI or HTTP_REFERER to be put into $_SERVER['']
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Simulacra wrote:REQUEST_URI or HTTP_REFERER to be put into $_SERVER['']
neither of those will tell you much about the user. The first will tell you the URI they requested on your server (if present), while the latter will tell you the URL the user was supposedly on before the current page request (very unreliable and very easily faked)
Simulacra
Forum Newbie
Posts: 7
Joined: Sun Sep 11, 2005 9:25 am

Post by Simulacra »

As I said I'm not to sure....
Post Reply