Welcome to WebmasterWorld Guest from 35.173.57.202

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Newbie Question

Simple PHP code?

     
3:20 pm on Jul 20, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts: 125
votes: 0


Is there a way to tell the network location of visitors to your site? I'm looking to see something like "verizon internet services inc." or "comcast cable communications inc."
3:27 pm on July 20, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:July 1, 2005
posts:112
votes: 0


Depending on your PHP configuration you can use $_SERVER['REMOTE_HOST'] or pass an ip address to gethostbyaddr() to find the visitors hostname.
eg -
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
or
$hostname = $_SERVER['REMOTE_HOST'];

this may not return a nicely formatted host name like you have specified, but it will give you the info you need, you could then clean up the string.

3:40 pm on July 20, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts:125
votes: 0


I'll give that a try, thanks!

I got the network locations from Google Analytics. That may be why they look like that.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members