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基于imap获取邮件实例

本文实例讲述了PHP基于imap获取邮件的方法。分享给大家供大家参考。具体实现方法如下: imap是一款邮件交互访问的协议了,下面是实例主要利用php imap模块来快速获取邮件,列出所...

php解决安全问题的方法实例

PHP安全配置 (1) 打开php的安全模式 php的安全模式是个非常重要的内嵌的安全机制,能够控制一些php中的函数,比如system(),同时把很多文件操作函数进行了权限控制,也不允...

利用PHPExcel实现Excel文件的写入和读取

作为一个原本的Java党,用过PHP才知道,原来对于Excel文件的写入和读取原来可以这么简单! 利用PHP实现对于Excel的读取,主要借助于PHPExcel插件来完成。 PHPExc...

PHP入门教程之正则表达式基本用法实例详解(正则匹配,搜索,分割等)

本文实例讲述了PHP正则表达式基本用法。分享给大家供大家参考,具体如下: Demo1.php <?php //尝试着写第一个正则表达式 //第一个参数,表示模式(就...

深入apache host的配置详解

<VirtualHost *:80>    ServerAdmin webmaster@dummy-host.127.0.0.1 &n...