{ $info['hosturl'] = $info['hostname'] = "localhost"; }
// Check the hosting company if(strpos($_SERVER['HTTP_HOST'], ".") !== false) { $host_url = "http://www.whoishostingthis.com/".str_replace(array('http://', 'www.'), '', $_SERVER['HTTP_HOST']);
$hosting = fetch_remote_file($host_url);
if($hosting) { preg_match('#We believe \<a href\="http:\/\/www.whoishostingthis.com\/linkout\/\?t\=[0-9]&url\=?([^"]*)" (title="([^"]*)" )target\=\_blank\>([^<]*)\<\/a\>#ism', $hosting, $matches);
$info['hosturl'] = "unknown/no-url"; if(isset($matches[1]) && strlen(trim($matches[1])) != 0 && strpos($matches[1], '.') !== false) { $info['hosturl'] = strtolower($matches[1]); } else if(isset($matches[3]) && strlen(trim($matches[3])) != 0 && strpos($matches[3], '.') !== false) { $info['hosturl'] = strtolower($matches[3]); }
if(isset($matches[4]) && strlen(trim($matches[4])) != 0) { $info['hostname'] = $matches[4]; } elseif(isset($matches[3]) && strlen(trim($matches[3])) != 0) { $info['hostname'] = $matches[3]; } elseif(isset($matches[2]) && strlen(trim($matches[2])) != 0) { $info['hostname'] = str_replace(array('title=', '"'), '', $matches[2][0]); } elseif(strlen(trim($info['hosturl'])) != 0 && $info['hosturl'] != "unknown/no-url") { $info['hostname'] = $info['hosturl']; } else { $info['hostname'] = "unknown/no-name"; } }
| { $info['hosturl'] = $info['hostname'] = "localhost";
|