Parsing the returned location string

General Discussion about IP Address Lookup caveats, technology, ideas, etc.

Moderator: Moderators

Parsing the returned location string

Postby JohnC on Wed Mar 30, 2005 5:13 am

When the Hostip database cannot identify the location it provides generic answers, two that I have seen have been (private address) and (unknown), what are the others? I would like to know this because I would like to identify when the database has no answer so that I do not say ‘Welcome surfer you are from (unknown city)’. Also I have noticed with the U.S. locations the state abbreviation is also returned is this done with any other country. Any other information that will permit me to correctly parse the returned location string will be appreciated. Thanks.
JohnC
n00b
 
Posts: 1
Joined: Wed Mar 30, 2005 3:20 am

Re: Parsing the returned location string

Postby bfolkens on Thu Mar 31, 2005 1:01 pm

JohnC wrote:When the Hostip database cannot identify the location it provides generic answers, two that I have seen have been (private address) and (unknown), what are the others? I would like to know this because I would like to identify when the database has no answer so that I do not say ‘Welcome surfer you are from (unknown city)’. Also I have noticed with the U.S. locations the state abbreviation is also returned is this done with any other country. Any other information that will permit me to correctly parse the returned location string will be appreciated. Thanks.


I would search for the strings 'Unknown' and/or 'Private' - if you're using the get.html or get.XML scripts

If only a country is known, it will return the string with 'Unknown' for the city at least. The one on the frontpage tries to guess in this case, but the API version will say 'Unknown' in the city field

Hope this helps
bfolkens
Site Admin
 
Posts: 154
Joined: Tue Feb 22, 2005 8:09 am


Return to IP Address Lookup

Who is online

Users browsing this forum: No registered users and 4 guests

cron