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使用微信开发模式实现搜索已发送图文及匹配关键字回复的方法

本文实例讲述了PHP使用微信开发模式实现搜索已发送图文及匹配关键字回复的方法。分享给大家供大家参考,具体如下: 用户发送关键字,搜索相应的图文进行回复。 模拟登陆就不说了 右键看“已发送...

php循环检测目录是否存在并创建(循环创建目录)

循环创建目录方法 这个会生成image.gif目录 复制代码 代码如下: $filepath = "test/upload/2010/image.gif"; mk_dir($filepa...

PHP新手NOTICE错误常见解决方法

刚学习PHP,不久,一般就看看手册,和一本叫PHP和mysql web开发的。 最近在整留言板,刚才遇到个问题。 页面中,好多类似 Notice: Use of undefined co...

php绘制圆形的方法

本文实例讲述了php绘制圆形的方法。分享给大家供大家参考。具体实现方法如下: php绘图的基本步骤,有四步(php.ini里的 extension = php_gb2.dll 组件首先需...

php5中类的学习

复制代码 代码如下:<?php      class TEST     ...