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面向对象分析设计的61条军规小结

(1)所有数据都应该隐藏在所在的类的内部。 (2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。 (3)尽量减少类的协议中的消息。 (4)实现所有类都理解的最基本公有接口[例如...

PHP扩展Memcache分布式部署方案

基础环境 其实基于PHP扩展的Memcache客户端实际上早已经实现,而且非常稳定。先解释一些名词,Memcache是danga.com的一个开源项目,可以类比于MySQL这样的服务,...

PHPMailer的主要功能特点和简单使用说明

支持邮件 s/mime加密的数字签名 支持邮件多个 TOs, CCs, BCCs and REPLY-TOs 可以工作在任何服务器平台,所以不用担心WIN平台无法发送邮件的问题的 支持文...

原生PHP实现导出csv格式Excel文件的方法示例【附源码下载】

原生PHP实现导出csv格式Excel文件的方法示例【附源码下载】

本文实例讲述了原生PHP实现导出csv格式Excel文件的方法。分享给大家供大家参考,具体如下: 效果图 源码分析 index.php <?php require_o...

PHP 中关于ord($str)&amp;gt;0x80的详细说明

GBK简体字符集的编码是同时用1个字节和2个字节来表示的。当高位是0x00~0x7f时,为一个字节,高位为0x80以上时用2个字节表示" 注:括号里面都是2进制 当你发现一个字节的内容大...