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将数据库中所有内容生成静态html文档的代码

复制代码 代码如下: <?php /* author:www.5dkx.com done:生成html文档 date:2009-10-27 */ require_once("con...

PHP基于DOM创建xml文档的方法示例

本文实例讲述了PHP基于DOM创建xml文档的方法。分享给大家供大家参考,具体如下: DOM创建xml文档 用dom创建如下文档: <booklist>   <bo...

PHP中的integer类型使用分析

integer 可以已10进制,8进制,16进制表示。 用八进制表示的时候,数字需要已0(零)开头; 用十六进制表示的时候,数字需要已0x(零x)或者0X(零大写X)开头; intege...

自己写的兼容低于PHP 5.5版本的array_column()函数

array_column 用于获取二维数组中的元素(PHP 5.5新增函数),但我们有时候需要在低版本的PHP环境中使用… if( ! function_exists('array_...

PHP实现的文件上传类与用法详解

本文实例讲述了PHP实现的文件上传类与用法。分享给大家供大家参考,具体如下: FileUpload.class.php,其中用到了两个常量,可在网站配置文件中定义:define('ROO...