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 远程关机实现代码

复制代码 代码如下: <?php /** * 远程启动计算机 * 注意:iis/apache需要有windows/system/cmd.exe执行权限 * name:薛如飞 * q...

php-cli简介(不会Shell语言一样用Shell)

1.基础知识 1.1 什么是Shell编程? 在 Unix 中,shell 可不是简单的命令解释器(典型的有 Windows 中的 DOS ),而是一个全功能的编程环境。Shell 是操...

PHP文件操作实现代码分享

PHP文件操作实现代码分享

将数据写或读入文件,基本上分为三个步骤: 1. 打开一个文件(如果存在) 2. 写/读文件 3. 关闭这个文件 l打开文件 在打开文件文件之前,我们需要知道这个文件的路径,以及此文件是否...

PHP flush 函数使用注意事项

ob_*系列函数, 是操作PHP本身的输出缓冲区. 所以, ob_flush是刷新PHP自身的缓冲区. 而flush, 严格来讲, 这个只有在PHP做为apache的Module(han...

PHP实现邮件群发的源码

复制代码 代码如下: <?php  // 请求 PHPmailer类 文件  require_once("class.phpmailer.php");...