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使用timthumb生成缩略图的方法

本文实例讲述了php使用timthumb生成缩略图的方法。分享给大家供大家参考,具体如下: 生成缩列图有二种方式: 一、提前生成好,供调用 缩列图常规做法是,开始根据网站中的图片规格,要...

php 使用expat方式解析xml文件操作示例

本文实例讲述了php 使用expat方式解析xml文件操作。分享给大家供大家参考,具体如下:test.xml:<?xml version="1.0"&n...

PHP错误提示的关闭方法详解

最简单的办法就是直接在php程序代码中加入下面代码: 复制代码 代码如下:error_reporting(E_ALL^E_NOTICE^E_WARNING); 可以关闭所有notice...

Ajax PHP 边学边练 之三 数据库

Ajax PHP 边学边练 之三 数据库

本篇将继续通过该实例讲解与数据库的交互方式。实例中用到的是MySQL,也可以根据自己的需要替换为其他数据库,其连接方式可以参考PHP相关手册。 在下面源程序包中dbconnector.p...

php 网址url转迅雷thunder资源下载地址的方法函数

其实迅雷的地址就是:原url前面带AA,后面带ZZ之后再base64_encode编码即可即:  thunder:// + base64_encode("AA" +&nb...