Page 1 of 1

Parsing the returned location string

PostPosted: Wed Mar 30, 2005 5:13 am
by JohnC
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.

Re: Parsing the returned location string

PostPosted: Thu Mar 31, 2005 1:01 pm
by bfolkens
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