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实现的字符串匹配算法示例【sunday算法】

本文实例讲述了PHP实现的字符串匹配算法————sunday算法。分享给大家供大家参考,具体如下: Sunday算法是Daniel M.Sunday于1990年提出的字符串模式匹配。其核...

PHP7数组的底层实现示例

PHP7数组的底层实现示例

PHP 数组具有的特性 PHP 的数组是一种非常强大灵活的数据类型,在讲它的底层实现之前,先看一下 PHP 的数组都具有哪些特性。 可以使用数字或字符串作为数组健值 $arr =...

解决PhpMyAdmin中导入2M以上大文件限制的方法分享

要处理这个问题,经过一番研究发现,有2种方法:方法一: 找到php.ini搜索这3个地方 upload_max_filesize , memory_limit 和 post_max_si...

WordPress导航菜单的滚动和淡入淡出效果的实现要点

滚动导航菜单 滚动菜单, 顾名思义是以滚动的方式显示和隐藏菜单的. 其实跟淡入淡出菜单和滚动菜单的原理是一样的, 前者是在触发事件的时候改变菜单的透明度, 而后者则是改变菜单的高度. 那...

PHP单例模式模拟Java Bean实现方法示例

PHP单例模式模拟Java Bean实现方法示例

本文实例讲述了PHP单例模式模拟Java Bean实现方法。分享给大家供大家参考,具体如下: 问题: 根据如下杨辉三角形 实现一个get_value($row,$col)方法: (前一...