<?php
header('Content-type: text/html; charset=utf-8');
header("Cache-Control: no-cache, must-revalidate");
require('function.php');

$type = trim($_GET['type']);
$name = trim($_GET['name']);
$url = trim($_GET['url']);

$domain = getDomain($url);

if ($type == 'ip')
{
	echo 'IP及地理位置：'.getIPAddr($url);
}
elseif ($type == 'status')
{
	echo '服务器状态：'.getHeaders($url);
}
elseif ($type == 'domain')
{
	echo '域名相关信息：'.getDomainInfo($domain);
}
elseif ($type == 'pr')
{
	echo getPageRank($url);
}
elseif ($type == 'alexa')
{
	echo getAlexaRank($domain);
}
elseif ($type == 'srank')
{
	echo getSogouRank($url);
}
elseif ($type == 'crank')
{
	echo getChinaRank($url);
}
elseif ($type == "baidu")
{
	echo getBaiduIndex($url, $name);
}
elseif ($type == "google")
{
	echo getGoogleIndex($url, $name);
}
elseif ($type == "bing")
{
	echo getBingIndex($url, $name);
}
elseif ($type == "yahoo")
{
	echo getYahooIndex($url, $name);
}
elseif ($type == "soso")
{
	echo getSosoIndex($url, $name);
}
elseif ($type == "sogou")
{
	echo getSogouIndex($url, $name);
}
elseif ($type == "youdao")
{
	echo getYoudaoIndex($url, $name);
}
elseif ($type == "altavista")
{
	echo getAltaVistaIndex($url, $name);
}
elseif ($type == "alltheweb")
{
	echo getAlltheWebIndex($url, $name);
}
?>