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 function check_wap() { if (isset($_SERVER['HTTP_VIA'])) return true;...

php实现字符串翻转的方法

本文实例讲述了php实现字符串翻转的方法。分享给大家供大家参考。具体实现方法如下: <?php header("content-type:text/html;chars...

生成卡号php代码

复制代码 代码如下:<?php     $a=1; //开始     $b=2; ...

php include,include_once,require,require_once

include_once和require_once的作用差不多,就是在包含的时候检查被包含的文件是不是已经包含过,如果包含过,那就不执行,否则再包含.我先说这个的原因是因为如果把incl...

PHP单例模式简单用法示例

本文实例讲述了PHP单例模式用法。分享给大家供大家参考,具体如下: <?php class db { public $conn; public static $...