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操作Mongodb封装类完整实例

本文实例讲述了PHP操作Mongodb封装类。分享给大家供大家参考,具体如下: <?php /** * Mongodb 基本操作API,支持基本类似关系统型数据库的操作...

php基于dom实现的图书xml格式数据示例

本文实例讲述了php基于dom实现的图书xml格式数据。分享给大家供大家参考,具体如下: <?php $books = array(); $books [] = a...

PHP filesize函数用法浅析

filesize() 函数返回指定文件的大小。 若成功,则返回文件大小的字节数。若失败,则返回 false 并生成一条 E_WARNING 级的错误。 php filesize()函数...

详解PHP 7.4 中数组延展操作符语法知识点

详解PHP 7.4 中数组延展操作符语法知识点

在数组表达式中对展开操作符(Spread Operator)支持的 RFC 投票是 绝大多数人赞同 将此功能添加到 PHP 7.4。 扩展运算符支持参数解包首先存在于 PHP 5.6...

Yii中render和renderPartial的区别

以下由我们在信易网络公司开发项目的时候终结出的一些经验 在进行页面输出渲染的时候。 1.render 输出父模板的内容,将渲染的内容,嵌入父模板。| 2.renderPartial 则不...