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小偷程序)

如题,返回一个数组,可以获得图片地址的base url,相对地址,名称等,具体见下例: <? error_reporting(E_ALL ^ E_NOTICE); $...

PHP 日期加减的类,很不错

如何使用这个类呢?请看下面的演示: 复制代码 代码如下: $temptime = time(); echo strftime ( "%Hh%M %A %d %b" , $temptime...

浅析php插件 Simple HTML DOM 用DOM方式处理HTML

simple_html_dom插件用dom处理html文件的利器使用:加载simple_html_dom.php文件复制代码 代码如下:require_once 'simple_html...

7个超级实用的PHP代码片段

1、超级简单的页面缓存 如果你的工程项目不是基于 CMS 系统或框架,打造一个简单的缓存系统将会非常实在。下面的代码很简单,但是对小网站而言能切切实实解决问题。 复制代码 代码如下: &...

php中关于codeigniter的xmlrpc的类在进行数据交换时的类型问题

客户端发送的请求类似这样 复制代码 代码如下: $request = array('parameters00','parameters01'); 在客户端的请求你可以制定参数的数据类型...