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加入ftp扩展的解决方法

首先,进入源码目录cd php-5.2.13/ext/ftp #运行phpize生成configure/usr/local/php/bin/phpize #编译,指定php-config...

PHP更新购物车数量(表单部分/PHP处理部分)

表单部分: 复制代码 代码如下: <form action="?action=edit_num" method="post" name="car<?php $c_rs['id...

php中magic_quotes_gpc对unserialize的影响分析

本文实例分析了php中magic_quotes_gpc对unserialize的影响。分享给大家供大家参考。具体如下: magic_quotes_gpc是一个php中一个给单双引号增加一...

LINUX下PHP程序实现WORD文件转化为PDF文件的方法

本文实例讲述了LINUX下PHP程序实现WORD文件转化为PDF文件的方法。分享给大家供大家参考,具体如下: <?php set_time_limit(0); func...

PHP文件上传原理简单分析

//表单上传只能使用multipart/form-data编码格式 $_FILES系统函数; $_FILES['myFile']['name']文件名称 $_FILES['myFile'...