Jump to content

php get exact coordinates by IP


vaskovasilev

Recommended Posts

hello,

i want to get the exact coordinates of IP address - latitude, longitude.

i am using google geocode but it needs to confirm that you want to share the information.

after that i tried other methods - ipinfodb.. and others api but they didnt give me the same coordinates as google.

is there any way ?

 

Link to comment
Share on other sites

I guess not no. As the reason for the confirmation would be for privacy. if you are tracking geolocation you should tell the user.

Most browsers nowadays do just that - they ask the user if they want to execute the geolocation part of the script, if there is any. There is no way to force the browser into sending the exact coordinates to your server (unless of course you use malicious approaches to this).

Link to comment
Share on other sites

there are many sites that take the coordinates without google, but they are very close to google coordinates.

i tried some api but .. they are not so close.

i ask this - is there a tool, web service, php, database that will give me the closest coordinates that give me google.

in this case there wont be confirmation.

Link to comment
Share on other sites

  • 1 month later...

There is now way to do what you are trying to. You cannot get someone's location via a browser without some sort of confirmation. If your building a mobile app (IOS/Android) then you can access the GPS, but still it would require the necessary permissions.  In regards to checking someones browser and getting the location, that is not possible. There are ways to get pretty close to the location (very close actually) but not without confirmation.

 

You can get Longitude/Latitude using HTML 5 though.

 

http://www.w3schools.com/html/html5_geolocation.asp

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

 

Either way, good luck!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.