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基于GD2函数库实现验证码功能示例

PHP基于GD2函数库实现验证码功能示例

本文实例讲述了PHP基于GD2函数库实现验证码功能。分享给大家供大家参考,具体如下: 在正式制作验证码之前要先补充点知识,PHP使用GD2函数库实现对各种图形图像的处理,所以我们制作验证...

php一些公用函数的集合

/*获得客户端ip地址*/     function getIP() {      &...

CURL的学习和应用(附多线程实现)

CURL的学习和应用(附多线程实现)

curl安装:windows下面的安装:修改php.ini文件的设置,找到php_curl.dll//取消下在的注释extension=php_curl.dll linux下面安装:复制...

PHP中使用CURL获取页面title例子

通过PHP获取页面title内容的实战演示: 范例代码: 复制代码 代码如下: <?php   /*  功能: 取得 URL 页面上的 &...

提高define性能的php扩展hidef的安装和使用

提高define性能的php扩展hidef的安装和使用

官网:http://pecl.php.net/package/hidef简介:  Allow definition of user defined constants in simple...