Help - Search - Members - Calendar
Full Version: Location from IP?
Invision Power Services > Community Forums > Community Web Design and Coding
Michael Boutros
Is there any way to get City, State from an IP address?
Anthony T.
http://www.dnsstuff.com/

Middle row, 4 down
Michael Boutros
And how can I incorporate this using PHP?
_
sockopen()
Michael Boutros
That's what I am reading about right now, but I am very confused. Can you provide me with some sort of example as to how I would do this?
_
I don't know much about sockets, but you could just open a socket to their service, then 'GET /tools/city.ch?ip=ip_address'... I know close to nothing about sockets using PHP, but if you want, I can write you a Perl function you can then rewrite to PHP... If you know Perl, that is.
Bøb
It isn't really that accurate though. it more depends where the users IPS is located and not the user themselves... it says london for me when i am nearer glasgow...
Why Two Kay
IP Address Locator
.John.
I just do a WHOIS search:

http://www.whois.sc/invisionpower.com

Or, you can use an IP...
Michael_C
If you only need the country: http://ip-to-country.webhosting.info/.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.