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排序二叉树基本功能实现方法示例

本文实例讲述了PHP排序二叉树基本功能实现方法。分享给大家供大家参考,具体如下: 这里演示了排序二叉树节点的插入,中序遍历,极值的查找和特定值的查找的功能. 基本没有提供什么概念和定义....

php创建类并调用的实例方法

PHP类定义 PHP 定义类通常语法格式如下: <?phpclass phpClass { var $var1; var $var2 = "constant s...

探讨如何在PHP开启gzip页面压缩实例

示例一(用php的内置压缩函数):复制代码 代码如下:<?PHP if(Extension_Loaded('zlib')) Ob_Start('ob_gzhandler'); He...

验证token、回复图文\文本、推送消息的实用微信类php代码

本文实例为大家分享了用于验证token,回复图文、文本,向用户推送消息等功能的微信类,具体代码如下 <?php class Wechat{ private $dat...

php笔记之常用文件操作

复制代码 代码如下:<?php //常用文件操作函数 //第一部分 文件读写 与创建 删除 重命名等 //在开始前操作文件前 我们先判断一下是否是个文件 文件是否可执行 可读 可写...