Mugilan Ragupathi
Mugilan Ragupathi

Reputation: 189

Getting the Country,City name from IPAddress in PHP

I would like to get the City name,Country Name from IPAddress. I have used the below URL http://www.ipgp.net/api/xml/220.244.120.73.

But in the City field, its giving Area name. For eg,when the user is in Sydney,Australia. Its giving as Mascot,Australia where Mascot is a place in Sydney.

Upvotes: 0

Views: 2210

Answers (1)

Pekka
Pekka

Reputation: 449783

This is usually not possible, because ISPs don't publicize such detailed information. (IP-based Geolocation services work a lot with guesses and hazy algorithms in the first place.) The more exact the geolocation, the more this would also become a privacy problem.

If you need such detailed information, consider the new HTML 5 Geolocation API that allows visitors to disclose location information voluntarily.

Upvotes: 1

Related Questions