By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

Getting your geographical location

P: n/a
Hey,

How does one going about their user's geographical location? Is that
even a PHP question.

For example, a site may say "Find others near Boston", but if you were
in New York, it would say "Find others in New York"

Thanks.
Aug 13 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
rpupkin77 wrote:
Hey,

How does one going about their user's geographical location? Is that
even a PHP question.

For example, a site may say "Find others near Boston", but if you were
in New York, it would say "Find others in New York"

Thanks.
Hi,
Not really a PHP question, but I've used maxminds geoip product and it
is quite good.

http://www.maxmind.com/app/php

This document tells you the various methods of how to use PHP with it.

--
Hope this helps, Cheers
Leigh Finch
www.phpmaniac.net
Aug 13 '08 #2

P: n/a
If you are really clever you could also ask 'whois' and parse the
reply. I think that's how MaxMind and others have built their
databases. Here you get the most current and most precise information
available via net infrastructure.

But be cautios: The problem I had with MaxMind's database was that of
many users connected via ISP I only got the ISP's location which
frequently is a few hundred miles away. From my current office in
Germany I am connected to the net via Italy giving me Italian Google
search pages...

virtuPIC
--
Airspace V - international hangar flying!
http://www.airspace-v.com/ggadgets for tools & toys
Aug 13 '08 #3

P: n/a
On 13 Aug, 07:18, virtuPIC <WebMas...@airspace-v.comwrote:
If you are really clever you could also ask 'whois' and parse the
reply. I think that's how MaxMind and others have built their
databases. Here you get the most current and most precise information
available via net infrastructure.

But be cautios: The problem I had with MaxMind's database was that of
many users connected via ISP I only got the ISP's location which
frequently is a few hundred miles away. From my current office in
Germany I am connected to the net via Italy giving me Italian Google
search pages...

virtuPIC
--
Airspace V - international hangar flying!http://www.airspace-v.com/ggadgetsfor tools & toys
I'd also question the usefulness of IP address to geography mappings.
The easiest way to find out where a user is would be to **ask** them!
Of course, most users tend to think in terms of towns/cities and
countries rather than lattitude and longitude - and you'd want the
results in a strucutred format - which rather suggests clicking on
selection criteria rather than free text input.

IIRC the phpclassess website does geographical data manipulation to
find local user groups. Also, The CIA World Fact Book data seems to
published on a redistributable basis - although getting hold of the
raw data & metadata might be tricky. There may well be published
public listings of cities in the world - try google for a start. If
that trail goes cold, try chasing up from micro-formats and/or Mozilla
labs (who are actively looking at pushing data manipulation out to the
browser).

C.
Aug 13 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.