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

相关文章

Netbeans 8.2将支持PHP7 更精彩

Netbeans 8.2将支持PHP7 更精彩

首先,将PHP项目的PHP版本设置为PHP 7.0。 PHP 7其中一项新特性是返回类型声明,即PHP的函数和方法可以声明指定类型的返回值: PHP 7的另一项精彩的改进就是参数的...

PHP实现的消息实时推送功能【基于反ajax推送】

本文实例讲述了PHP实现的消息实时推送功能。分享给大家供大家参考,具体如下: 入口文件index.html <!DOCTYPE HTML> <html> &l...

PHP自动生成表单代码分享

Form.php <?php //Form.php class form { var $layout=true;//是否使用表格布局 var $act...

php设计模式 DAO(数据访问对象模式)

复制代码 代码如下: <?php /** * 数据访问对象(Data Access Object) 示例 * * @create_date: 2010-01-04 */ class...

PHP源码之explode使用说明

当我们需要将一个数组根据某个字符或字串进行分割成数组的时候,explode用的很happy,但是你知道~explode是怎么工作的么~~ 首先可以肯定的是,explode也是会分配空间的...