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

相关文章

PHP7扩展开发之hello word实现方法详解

本文实例讲述了PHP7扩展开发之hello word实现方法。分享给大家供大家参考,具体如下: 这里是以PHP7作为基础,讲解如何从零开始创建一个PHP扩展。本文主要讲解创建一个扩展的基...

PHP邮件群发机实现代码

原理: 第一:申请大量的邮箱帐号 腾讯的 126的 163的 新浪的 雅虎的 谷歌的 等等提供smtp服务的 第二:收集你要发送邮件的邮件列表 第三:遍历邮件列表,每一个邮件发送邮...

php简单浏览目录内容的实现代码

如下所示:复制代码 代码如下:<?php$dir = dirname(__FILE__);$open_dir = opendir($dir);echo "<table bor...

php函数间的参数传递(值传递/引用传递)

php:函数间的参数传递 1.值传递 复制代码 代码如下: <?php function exam($var1){ $var1++; echo "In Exam:" . $var1...

php中使用ExcelFileParser处理excel获得数据(可作批量导入到数据库使用)

复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o...