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获得数组交集与差集的方法。分享给大家供大家参考。具体分析如下: 一、数组的交集 array_intersect() array_intersect()函数返回一个保留...

php之curl实现http与https请求的方法

本文实例讲述了php之curl实现http与https请求的方法,分享给大家供大家参考。具体如下: 通常来说,php的curl函数组可以帮助我们把机器伪装成人的行为来抓取网站,下面来分享...

PHP使用缓存即时输出内容(output buffering)的方法

PHP使用缓存即时输出内容(output buffering)的方法。分享给大家供大家参考。具体如下: $buffer = ini_get('output_buffering');...

php PDO中文乱码解决办法

// 方法一: PDO::__construct($dsn, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NA...

详解PHP中的外观模式facade pattern

关于facade这个词的翻译 facade这个词,原意指的是一个建筑物的表面、外观,在建筑学中被翻译为“立面”这个术语,国内对facade这个词的关注,可能更多要依赖于laravel的...