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

PHP
php基础知识:类与对象(5) static
谈谈新手如何学习PHP
Breeze 文章管理系统 v1.0.0正式发布
缓存技术详谈—php
php 进阶:实现无限分类
落伍首发 php+mysql 采用ajax技术的 省 市 地 3级联动无刷新菜单 源码
PHP读MYSQL中文乱码的解决方法
亲密接触PHP之PHP语法学习笔记1
IIS环境下快速安装、配置和调试PHP5.2.0
转PHP手册及PHP编程标准
PR值查询 | PageRank 查询
PHP函数utf8转gb2312编码
PHP 模板高级篇总结
PHP 编程请选择正确的文本编辑软件
使用 MySQL 开始 PHP 会话
PHP 的几个配置文件函数
剖析 PHP 中的输出缓冲
Windows2003 下 MySQL 数据库每天自动备份
30分钟学会用PHP写带数据库的简单通讯录
php下看实例学正则表达式

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 127 ::
收藏到网摘: 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 病毒