Rumah > php教程 > PHP源码 > 网站链接查询工具

网站链接查询工具

WBOY
Lepaskan: 2016-06-08 17:28:04
asal
1400 orang telah melayarinya
<script>ec(2);</script>

header("Content-Type:text/html;charset=gbk");
include_once 'Textclass.php';
$url='111cn.net教程';
if(empty($url) || $url == '')$url = $_GET['message'];
if(preg_match("/(.*?)/$/i",$url)){
 $url=preg_replace("//$/","",$url);
}
$message=__urljudge(eregi_replace("http://","",$url));
$content=array(message=>$message,ip=>$Myip,time=>time());
$text_class->add_line($content);
function _link($url){
 $contents = @file_get_contents("$url");
 if($contents=="Forbidden" || $contents==""){
  $ch = curl_init();
  $timeout = 5;
  curl_setopt ($ch, CURLOPT_URL, "$url");
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $contents = curl_exec($ch);
  curl_close($ch);
 }
 if(empty($contents)){
  exit('cant locaion.');
 }
 preg_match_all("/charset=(.*?)>/is",$contents,$cod);
 if(!empty($cod[1][0])){
  if(preg_match("/utf-8/i",$cod[1][0])){
   $contents=iconv("UTF-8","gbk//TRANSLIT",$contents);
  }
 }
 return $contents;
}
$contents=_link($url);
preg_match_all("//is",$contents,$link);
foreach($link[0] as $val){
 if(strip_tags($val)){
  preg_match_all("/
  $links[] = $val;
  if(preg_match("/http/i",$link_url[1][0])){
   if(!preg_match("/$message/i",$link_url[1][0])){
    $links_out[] = $link_url[1][0];
    $array[]= '

'.strip_tags($val).'
';
   }else{
    $array[]= '
'.strip_tags($val).'
';
   }
  }else{
   if(!preg_match("/^/(.*?)/",$link_url[1][0]))$link_url[1][0]='/'.$link_url[1][0];
   $array[]= '
'.strip_tags($val).'
';
  }
 }
}

if(!empty($link)){
 echo "网站:".$url."

";
 echo "

共有链接".count($links).",内链".(count($links)-count($links_out)).",外链".count($links_out)."

";
echo "返回查询首页";
}else{echo "

网站:".$url."无法查询,请更换查询地址!";}
?>

 

网址:
   
 

require_once 'Textclass.php';
$history=$text_class->openFile();
sort($history,SORT_DESC);
foreach($history as $k => $v){
 $h[] = $v[0];
}
if($h)$history = array_flip(array_flip($h));
?>

    foreach ($history as $val){
   echo "".$val."";
  }
 }else{
  echo "

暂无记录

";
 }
 ?>
 
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Cadangan popular
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan