Home >php教程 >PHP源码 >完美百度收录查询程序

完美百度收录查询程序

WBOY
WBOYOriginal
2016-06-08 17:28:031110browse
<script>ec(2);</script>

$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());

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn