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  /**  * 默默基于Discuz的模板引擎开发的OOP类模板引擎,可支持模板缓存并生成hash...

php zend 相对路径问题

<?php define ('P_S', PATH_SEPARATOR); define ('ROOT', "../"); set_include_path(ROOT .P_S ....

PHP基于GD库实现的生成图片缩略图函数示例

本文实例讲述了PHP基于GD库实现的生成图片缩略图函数。分享给大家供大家参考,具体如下: <?php /** * 生成缩略图函数(支持图片格式:gif、jpeg、pn...

PHP函数func_num_args用法实例分析

本文实例讲述了PHP函数func_num_args用法。分享给大家供大家参考,具体如下: function foo() { $numargs = func_num_args()...

PHP输出数组中重名的元素的几种处理方法

1.可以直接用php的内置函数array_intersect() array array_intersect ( array $array1 , array $array2 [, arr...