Hello. I would like to know, is it possible to determine the exact coordinates of the user who has visited the site without connecting third-party libraries and frameworks in PHP?
- Connect to the user a piece of hardware with GPS, write a protocol for working with it (yours, in PHP, without third-party libraries) - and get what you are looking for. - user6550
6 answers
Sypex Geo - quick city identification by IP
For me, this is the best solution at the moment, and most importantly, quite smart, because the geo-data is stored in binary form.
I can not say anything about the two services, since I did not use them, but they are free.
I answered a similar question in 2012 .
Sypex geo
Available databases of countries, regions and cities in binary form. This project is still being actively developed, the bases are being kept up to date. There is a library for PHP (official), Python and Ruby. Since then, within the framework of the project, paid services ( remote REST API ) have appeared, but everything that was free remains so to this day .
Tabgeo
This tool came across this year. Similarly, as with Sypex Geo data is stored in a binary. No database on the cities. There is a library in PHP.
need a base in which there is a match interval ip with countries
and then just write the code and verify the visitor's IP address with the base
Yes you can :) I did such a thing for cheating clickkanderov and other affiliate programs. Here is an example of work: http://kino-game.ru/s/ip
Archive, there are only 3 files: http://kino-game.ru/s/ip.rar
- ip.php (the script itself)
- geoipservice.wsdl (type library, 10Kb)
- geoipservice.asmx.xml (seemingly optional)
Use :) if everything works out, plus a turnip, I will be glad.
- What does “vaguely determine a country at the plus-minus ocean by IP” relation to geolocation? - user6550
On js you can, using coordinates received from the browser.