How to use geolocation and google map

I have surf the web but still don’t find an explaining tutorial on how to use either google map or php google map to automatically detect the location of a user. This is what I want to achieve, during registration, a user current location will be extracted using either the js version of the map or the php version(depending on the one I saw a good way of using it), and extraction, the current town or city or village with also the country.

Who can really put me through on how to use any of the above library

I think you will find the answer with javascript rather than PHP. You are locating the client, not the server.

Moved from PHP to Javascript.

Hi @programmer, did you try google’s geolocation tutorial? The example code there is a complete, annotated working page you can fiddle with…

2 Likes

You should also take into account the inaccuracies present in these geolocation systems. I’m using a mobile broadband connection from a fixed location, always the same place (it’s a desktop PC) but when I visit a site that attempts to evaluate my location, the results are nonsense.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.