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输出缓存(output_buffering)的深入理解

首先明确一下PHP的输出顺序1.打开了php输出缓存: echo,print -> php output_buffring -> server buffering ->...

php中time()与$_SERVER[REQUEST_TIME]用法区别

php中time()与$_SERVER[REQUEST_TIME]用法区别

本文实例详细讲述了php中time()与$_SERVER[REQUEST_TIME]用法的区别。分享给大家供大家参考。具体分析如下: 简单的说time()与$_SERVER["REQUE...

php 数组二分法查找函数代码

复制代码 代码如下:<?php //search函数 其中$array为数组,$k为要找的值,$low为查找范围的最小键值,$high为查找范围的最大键值 function sea...

简单谈谈php中的unicode和utf8编码

简单谈谈php中的unicode和utf8编码

重新认识unicode和utf8编码 直到今天,准确的说是刚才,我才知道UTF-8编码和Unicode编码是不一样的,是有区别的囧 他们之间是有一定的联系的,看看他们的区别: UTF-8...

php获得当前的脚本网址

//获得当前的脚本网址 function GetCurUrl(){     if(!empty($_SERVER["REQUEST_...