[PHP] 敏感词语过滤 网站不良信息在线检查系统 →→→→→进入此内容的聊天室

来自 , 2019-05-12, 写在 PHP, 查看 112 次.
URL http://www.code666.cn/view/663772ea
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6.   <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  7.  
  8.   <title>网站不良信息在线检查系统</title>
  9. </head>
  10.  
  11. <body>
  12.   <?php
  13.   $site=$_GET[site]; //获取网址
  14.   if (!$site){echo "请填写完整url"; exit;}
  15.   if((!$censorFile=fopen("CensorWords.txt","r")))
  16.   {
  17.           print("找不到敏感词汇样本文件");
  18.           exit;
  19.   }
  20.   echo "<center>";
  21.   echo "<img src=\"images/17.jpg\" alt=\"构建和谐社会,人人有责!\"><br><br>";
  22.   echo "<div align=\"left\" style=\"width:468px\">";
  23.   $censorFile=file("CensorWords.txt");
  24.   foreach ($censorFile as $censorWords)
  25.   {
  26.           $censorWords=rtrim($censorWords,"\n\r");
  27.           $handle = @fopen("http://www.baidu.com/s?q1=site%3A".$site."&q2=".$censorWords,"r");
  28.           if ($handle) {
  29.                   while (!feof($handle))
  30.                   {
  31.                           $buffer = fgets($handle, 12000);
  32.                           //print ($buffer);//输出Buffer,调试用
  33.                           $listWords.=cut($buffer,"百度一下,找到相关网页","篇");
  34.                   }
  35.                   fclose($handle);
  36.           }
  37.  
  38.  
  39.           if ($listWords){
  40.                   echo "存在非法内容:".$listWords."条记录<a href='http://www.baidu.com/s?tn=macdown&ct=0&ie=gb2312&bs=site%3A".$site."&sr=1&z=&cl=3&f=8&wd=".$censorWords."' target=_blank>$censorWords</a><br>";
  41.                   $listWords="";}//清空关键词
  42.   }
  43.   echo "<br><br><strong>检测完毕,请及时删除不良信息!</strong><br>";
  44.  
  45.   function cut($file,$from,$end){
  46.           $message=explode($from,$file);
  47.           $message=explode($end,$message[1]);
  48.           return        $message[0];
  49.   }
  50.   print "<a href='http://www.mymac.com.cn' target='_blank'>中国苹果用户网</a> <script language=\"javascript\" type=\"text/javascript\" src=\"http://js.users.51.la/296026.js\"></script>
  51.  <noscript><a href=\"http://www.51.la/?296026\" target=\"_blank\"><img alt=\"&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;\" src=\"http://img.users.51.la/296026.asp\" style=\"border:none\" /></a></noscript>";
  52.   ?>
  53. </body>
  54. </html>
  55.  

回复 "敏感词语过滤 网站不良信息在线检查系统"

这儿你可以回复上面这条便签

captcha