Commit 1c736007 authored by David Morley's avatar David Morley

better geoip data source, add some data points to mobile

parent 9a3f383c
......@@ -18,6 +18,8 @@
echo "Uptime This Month " . $row["uptimelast7"] . "<br>";
echo "Months Monitored: " . $row["monthsmonitored"] . "<br>";
echo "Response Time: " . $row["responsetimelast7"] . "<br>";
echo "User Rating: ". $row["userrating"] . "<br>";
echo "Country: ". $row["country"] . "<br>";
}
pg_free_result($result);
pg_close($dbh);
......
......@@ -145,16 +145,21 @@ $ipv6="yes";
}
//curl ip
$hostip = curl_init();
curl_setopt($hostip, CURLOPT_URL, "http://api.hostip.info/get_html.php?ip=".$ipnum);
curl_setopt($hostip, CURLOPT_URL, "http://api.ip2locationapi.com/?user=".$geouser."&key=".$geokey."&format=text&ip=".$ipnum);
curl_setopt($hostip, CURLOPT_POST, 0);
curl_setopt($hostip, CURLOPT_HEADER, 0);
curl_setopt($hostip, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($hostip, CURLOPT_NOBODY, 0);
curl_setopt($hostip, CURLOPT_MAXCONNECTS, 5);
curl_setopt($hostip, CURLOPT_FOLLOWLOCATION, true);
$ipdata = curl_exec($hostip);
$ipraw = curl_exec($hostip);
curl_close($hostip);
$iparray = explode(",",$ipraw);
if ($iparray[1] != "-") {$ipdata = "Country: $iparray[1]\n";}
if ($iparray[2] != "-") {$ipdata .= "Region: $iparray[2]\n";}
if ($iparray[3] != "-") {$ipdata .= "City: $iparray[3]\n";}
echo $ipdata;
//curl the pingdom page
$ping = curl_init();
$thismonth = "/".date("Y")."/".date("m");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment