php 清除网页病毒的方法

yipeiwu_com6年前PHP代码库
<?php
Class clear_virus{
public $index ='b.html';
public $filepath =array('b.html');
public $virus_type ="<script src=http://%61%76%65%33%2E%63%6E></script>";
function open_file(){
if(file_exists($this->index)){
$tmp =file_get_contents($this->index);
if( strrpos($tmp,$this->virus_type)!== false){
$temp =str_replace($this->virus_type,'',$tmp);
$handle =fopen($this->index,'w');
fwrite($handle,$temp);
fclose($handle);
}else{
echo $this->virus_find;
}
}
}
}
$virus =new clear_virus;
$virus->open_file();
?>
清除script 病毒

相关文章

简单的过滤字符串中的HTML标记

function deleteHtml( $scr ) { $l = strlen( $scr );  for( $i=0; $i<$l; $i++ )&nbs...

Thinkphp实现自动验证和自动完成

Thinkphp实现自动验证和自动完成

Thinkphp的自动验证和自动完成都是根所表单提交的内容来的,对部分数据进行规则验证和处理后插入到数据库。 1、自动验证格式: array( array(验证字段1,验证规则...

PHP 调试工具Debug Tools

PHP 调试工具Debug Tools

发现了个调试PHP源码的好同志: PHP DEBUG TOOLS 其项目地址: http://freshmeat.net/projects/php-debug-tools/ 文件下载地址...

php基于curl实现随机ip地址抓取内容的方法

本文实例讲述了php基于curl实现随机ip地址抓取内容的方法。分享给大家供大家参考,具体如下: 使用php curl 我们可以模仿用户行为,既可以设置我们访问的ip及浏览器信息还可以设...

小文件php+SQLite存储方案

我们草根站长购买的虚拟主机往往都有文件数量限制,大量小文件占用大量资源,落伍精华区也有兄弟推荐豆瓣的解决方法,但是要有主机权限。只能另装思路,采用php+SQLite解决问题,经过我测试...