[php]代码库
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网站不良信息在线检查系统</title>
</head>
<body>
<?php
error_reporting(0);
$site=$_GET[site]; //获取网址
if (!$site){echo "请填写完整url"; exit;}
if((!$censorFile=fopen("CensorWords.txt","r")))
{
print("找不到敏感词汇样本文件");
exit;
}
echo "<center>";
echo "<img src=\"images/17.jpg\" alt=\"构建和谐社会,人人有责!\"><br><br>";
echo "<div align=\"left\" style=\"width:468px\">";
$censorFile=file("CensorWords.txt");
foreach ($censorFile as $censorWords)
{
$censorWords=rtrim($censorWords,"\n\r");
$handle = @fopen("http://www.baidu.com/s?q1=site%3A".$site."&q2=".$censorWords,"r");
if ($handle) {
while (!feof($handle))
{
$buffer = fgets($handle, 12000);
//print ($buffer);//输出Buffer,调试用
$listWords.=cut($buffer,"百度一下,找到相关网页","篇");
}
fclose($handle);
}
if ($listWords){
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>";
$listWords="";}//清空关键词
}
echo "<br><br><strong>检测完毕,请及时删除不良信息!</strong><br>";
function cut($file,$from,$end){
$message=explode($from,$file);
$message=explode($end,$message[1]);
return $message[0];
}
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>
<noscript><a href=\"http://www.51.la/?296026\" target=\"_blank\"><img alt=\"我要啦免费统计\" src=\"http://img.users.51.la/296026.asp\" style=\"border:none\" /></a></noscript>";
?>
</body>
</html>
[源代码打包下载]