error_reporting(E_ALL); require_once 'includes/controllers.php'; //include('views/_header.php'); $q = $_GET['q']; //query method $a = $_GET['a']; //query action (ajax) if ($q == "dnslookup") { include 'views/_header.php'; include 'views/domainlookup.php'; include 'views/_footer.php'; } elseif ($q == "ajax") { ini_set('display_errors', 0); $domain = actualDomain($_GET['domain']); if ($a == "ip") { print ipLookup($domain); } if ($a == "madwireSystem") { print check_madwire_ip($domain); } if ($a == "bcStyles") { print check_bc_styles($domain); } if ($a == "dnsA") { print "<pre>" . diga($domain) . "</pre>"; } if ($a == "whois") { print "<pre>" . whois($domain) . "</pre>"; } if ($a == "dnsMX") { print "<pre>" . digmx($domain) . "</pre>";
function ipWhois($d) { return shell_exec("/usr/bin/whois " . ipLookup($d)); }
function ipgeo($d) { $ipaddress = ipLookup($d); $url = "http://www.telize.com/geoip/" . $ipaddress; $ch = curl_init(); // Disable SSL verification curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Will return the response, if false it print the response curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Set the url curl_setopt($ch, CURLOPT_URL, $url); // Execute $geoip_json = curl_exec($ch); // Closing curl_close($ch); // get the results and json_decode the answer $geoip_data = json_decode($geoip_json, true); return substr(substr(print_r($geoip_data, true), 7), 0, -2); }