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 class timer { var $time_start; var $time_end; function __construct() { $t...

PHP获取文件夹内文件数的方法

本文实例讲述了PHP获取文件夹内文件数的方法。分享给大家供大家参考。具体实现方法如下: function getfilecounts($ff){ $dir = './'.$ff;...

laravel 解决后端无法获取到前端Post过来的值问题

laravel 解决后端无法获取到前端Post过来的值问题

效果如下所示: 刚开始一直获取不到前端传过来的Post的值 一番分析后 发现 通过php 命令新建的控制器默认少引用 就是上图圈起来的这个 引入就问题解决了 当然 前提是路由要配置正确...

PHP实现无限极分类生成分类树的方法

本文实例讲述了PHP实现无限极分类生成分类树的方法。分享给大家供大家参考,具体如下: 现在的分类数据库设计基本都是:每一个分类有一个id主键字段,一个pid指向父类的id,这样便可实现无...

PHP编程中的Session阻塞问题与解决方法分析

本文实例讲述了PHP编程中的Session阻塞问题与解决方法。分享给大家供大家参考,具体如下: 使用session过程中,在开启session后,同一浏览器,执行同一程序,不同页面会被锁...