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 HTML代码串 截取实现代码

而且给的数据是HTML代码串,比如这样: <div class=”aaa”><a href=”/aaa.php?id=1″>张三</a> ...

php生成zip文件类实例

本文实例讲述了php生成zip文件类。分享给大家供大家参考。具体如下: <?php /* By: Matt Ford Purpose: Basic cla...

php $_SERVER当前完整url的写法

复制代码 代码如下:"http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];...

PHP中如何判断AJAX提交的数据

如果是ajax请求,以下表达式的值为真 $_SERVER["HTTP_X_REQUESTED_WITH"]==”XMLHttpRequest” 就是一个PHP的环境变量。...

php微信高级接口群发 多客服

本文实例为大家分享了php微信高级接口群发、多客服源码,供大家参考,具体内容如下 /** * 微信接口调用 * 依赖 * 全局变量 * global $uid 公众号用户id...