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上传图片生成缩略图(GD库)

首先来一段简单的php上传图片生成缩略图的详细代码,分享给大家供大家参考,具体内容如下 <?php function createThumbnail($imageDir...

解析PHP可变函数的经典用法

复制代码 代码如下:<?phpfunction map($fun, $list,$params=array()){    $acc=NULL;&nbs...

php实现自定义中奖项数和概率的抽奖函数示例

本文实例讲述了php实现自定义中奖项数和概率的抽奖函数。分享给大家供大家参考,具体如下: <?php /* * 一个抽奖类,精确到万分之一 * 三个步骤:1.接受一个中...

PHP获取访问设备信息的方法示例

本文实例讲述了PHP获取访问设备信息的方法。分享给大家供大家参考,具体如下: <?php header("Content:Content-type:text/html;...

PHP实现的mongoDB数据库操作类完整实例

本文实例讲述了PHP实现的mongoDB数据库操作类。分享给大家供大家参考,具体如下: 最近的项目开发中使用的数据库是mongodb数据库,因为小编的公司也是刚刚使用mongodb数据库...