$q=strtolower(trim($_GET['q']));
$q=matchdomain($q);
if($q==''){exit;}
function matchdomain($q){
preg_match('/(([a-z0-9]w{0,61}?[a-z0-9]|[a-zA-Z0-9]).){1,}(aero|arpa|asia|biz|cat|com|coop|co|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z][a-z])(.[a-z][a-z]){0,1}/', $q, $matches);
return $matches[0];
}
for($i=0;$i
$pagecode = @file_get_contents("http://www.baidu.com/s?rn=1&wd=site:".$q);
if($pagecode){
break;
}
}
if($pagecode){
preg_match('/百度一下,找到相关网页(约)?(.*?)篇,用时/', $pagecode, $baidus);
if($baidus[2]){
$sitebaidu=$baidus[2];
}else{
$sitebaidu=0;
}
echo " ";
echo " ";
}else{
$sitebaidu=-1;
echo " ";
echo " ";
}
require_once $_SERVER['DOCUMENT_ROOT'].'/inc/conn.php';
$sitebaidu=(int)str_replace(',','',$sitebaidu);
$domaindate=$q.'|'.date('Y-m-d',time());
$insertsql="UPDATE c_indexed sitebaidu='$sitebaidu' where domaindate='$domaindate'";
$result=mysql教程_query($insertsql);
//or die(mysql_error());