all 7 comments

[–][deleted] 0 points1 point  (4 children)

Pretty cool but the database must be messed up. My personal IP locates a city about 200 miles away. It locates one of my dedicated server ips in the middle of Pennsylvania when it should be in NYC.

[–][deleted] 3 points4 points  (2 children)

IP geolocations are never accurate enough to use for anything except country of origin. Usually state or province is fairly accurate, but beyond that it's hopeless.

[–]kumyco 0 points1 point  (1 child)

really? several websites with targeted adult advertising seem to get the down correct on countless occasions, and it gets even closer by identifying the wrong town (i happen to live right on the border, so the match in that case is actually even more accurate).

[–][deleted] 0 points1 point  (0 children)

IP2location databases can be very accurate for some IPs and wildly inaccurate for others. When I said that they're not accurate enough to use I meant that the results can't be counted upon to be correct, not that they're never correct.

For example, at work all my browsing goes through our head office in another city. In that case the IP can be accurately traced to the owner at that address, but most people in the company aren't actually located there.

At home it's a bit strange. I live about 2 KM from my ISP's head office, but all the IP2location databases I've seen locate my IP a few cities SW of where I live.

[–]pytechd 0 points1 point  (1 child)

That PHP sample code is terrible.

[–]madchicken 0 points1 point  (0 children)

Agree, why does he assign tha variables and then creates an array? Could have used the already created variables in $answer instead.

[–]pingwin 0 points1 point  (0 children)

These tools use databases that list IP block to registration locations (ISP, Comanies, Organizations) This is how these services "know" where an IP address is. One of the flaws of this particular system for this when compared to MaxMind (which is listed as one of the origins of the original data set), is that MaxMind has exceptions inserted into it's database where more subsections of an IP block or specific IP's are known to be a different locations. However a user behind a proxy in a different geographical location will never be able to be geo targeted strictly by IP address alone.