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简单实现快速排序的方法。分享给大家供大家参考。具体实现方法如下: function quicksort($seq) { if(!count($seq)) ret...

PHP PDOStatement::setFetchMode讲解

PDOStatement::setFetchMode PDOStatement::setFetchMode — 为语句设置默认的获取模式。(PHP 5 >= 5.1.0, PECL...

WordPress导航菜单的滚动和淡入淡出效果的实现要点

滚动导航菜单 滚动菜单, 顾名思义是以滚动的方式显示和隐藏菜单的. 其实跟淡入淡出菜单和滚动菜单的原理是一样的, 前者是在触发事件的时候改变菜单的透明度, 而后者则是改变菜单的高度. 那...

PHP数组循环操作详细介绍 附实例代码

PHP数组还是比较常用的,于是我研究了一下PHP数组循环操作,在这里拿出来和大家分享一下,希望对大家有用。PHP基本上就是一种数组语言。时常要进行大量的PHP数组循环操作,主要有两种方式...

PHP里的$_GET数组介绍

在开发过程中,GET和POST无处不在。$_GET 变量是一个数组,内容是由 HTTP GET 方法发送的变量名称和值。 $_GET 变量用于收集来自 method="get" 的表单中...