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 病毒

相关文章

discuz程序的PHP加密函数原理分析

原理如下,假如:   加密   明文:1010 1001   密匙:1110 0011   密文:0100 1010   得出密文0100 1010,解密之需和密匙异或下就可以了   解...

PHP采用get获取url汉字出现乱码的解决方法

本文实例讲述了PHP采用get获取url汉字出现乱码的解决方法。分享给大家供大家参考。具体方法如下: 一、问题: 本来打算这样使用 复制代码 代码如下:<a href="list....

php的4种常见运行方式

SAPI:Server Application Programming Interface服务端应用编程端口。他就是php与其他应用交互的接口,php脚本要执行有很多中方式,通过web服...

PHP以指定字段为索引返回数据库所取的数据数组

很多情况下,我们从接触一个新的项目到开发完成,再回过头来仔细浏览一下自己写的代码,很多都是我们以前用熟练的代码。所以,在完成每个新项目的时 候,适当的做些项目总结、代码总结,或许你会在以...

关于更改Zend Studio/Eclipse代码风格主题的介绍

关于更改Zend Studio/Eclipse代码风格主题的介绍

最近决定把几个IDE的代码样式统一一下,Visual Studio的还算好改,PHP目前用得不多,不过也打算给Zend Studio换身新装。 网上搜索的一些更改Zend Studio主...