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实现AES256加密算法实例

本文实例讲述了PHP实现AES256加密算法的方法,是较为常见的一种加密算法。分享给大家供大家参考。具体如下: aes.class.php文件如下: <?php /*...

PHP数学运算与数据处理实例分析

本文实例讲述了PHP数学运算与数据处理方法。分享给大家供大家参考,具体如下: 一.数值数据类型 PHP中,数字或数值数据以及数学函数的使用很简单。基本来说,要处理两种数据类型:浮点数和...

php实现批量删除挂马文件及批量替换页面内容完整实例

本文实例讲述了php实现批量删除挂马文件及批量替换页面内容的方法。分享给大家供大家参考,具体如下: <?php # functionality: 本程序可以扫描指...

PHP使用header()输出图片缓存实例

本文实例讲述了PHP使用header()输出图片缓存的方法。分享给大家供大家参考。具体分析如下: 在我们生成验证码时会需要直接输入图片,通常会使用到header("Content-typ...

PHP session垃圾回收机制实例分析

本文实例讲述了PHP session垃圾回收机制。分享给大家供大家参考,具体如下: session过期时间 在php.ini文件中有这样一个配置,这个配置表示session文件过期时间,...