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 万年历实现代码

使用PHP实现万年历功能的要点: •得到当前要处理的月份总共有多少天$days •得到当前要处理的月份的一号是星期几$dayofweek $days的作用:知道要...

PHP生成指定范围内的N个不重复的随机数

思路:将生成的随机数存入数组,再在数组中去除重复的值,即可生成一定数量的不重复随机数。 在PHP网站开发中,有时候我们需要生成指定范围内一定数量的不重复随机数,具体怎么设计这个生产随机数...

CodeIgniter php mvc框架 中国网站

我们很高兴的宣布 CodeIgniter 1.6.2 版正式发布。本次发布包括超过 29 个 BUG 修复和&nbs...

利用PHP实现图片等比例放大和缩小的方法详解

复制代码 代码如下:    function resizeimage($srcfile,$mySize){    $size=...