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 IP及IP段进行访问限制的代码

192.168.1.1 单个IP 192.168.1.* 这样代理 192.168.1.1-192.168.1-255 192.158.1.2-20 这样是代表192.158.1.2-1...

php 生成WML页面方法详解

由于静态的WAP页面在很多方面不能满足用户个性化的服务请求,因此通过WAP服务器端语言产生动态的WML页面,具有很广泛的应用价值和很高的商业价值。   WAP应用结构非常类似于Inter...

php实现的网页版剪刀石头布游戏示例

php实现的网页版剪刀石头布游戏示例

本文实例讲述了php实现的网页版剪刀石头布游戏。分享给大家供大家参考,具体如下: <?php /* * Created on 2016-11-25 * */ i...

PHP下SSL加密解密、验证、签名方法(很简单)

超级简单,依赖于OpenSSL扩展,这里就不多废话了,直接奉上代码 签名: function sign($data) { //读取私钥文件 $priKey = file_get_...

php中经典方法实现判断多维数组是否为空

复制代码 代码如下://判断一个数组是否为空 /** array( ); 空 array( array( ), array( ), array( ) ); 空 array( array(...