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 常用算法和时间复杂度

按数量级递增排列,常见的时间复杂度有:常数阶O(1),对数阶O(log2n),线性阶O(n),线性对数阶O(nlog2n),平方阶O(n2),立方阶O(n3)复制代码 代码如下://二分...

PHP中define() 与 const定义常量的区别详解

本文实例讲述了PHP中define() 与 const定义常量的区别。分享给大家供大家参考,具体如下: 前言 今天在Stackoverflow又看到一个很有趣的文章,所以翻译过后摘了过来...

PHP parse_ini_file函数的应用与扩展操作示例

本文实例讲述了PHP parse_ini_file函数的应用与扩展操作。分享给大家供大家参考,具体如下: parse_ini_file($filename, $process_secti...

ie6 动态缩略图不显示的原因

我在上传生成缩略图时,缩略图显示的链接如下; 复制代码 代码如下:< img src ="/index.php?action=sys_upload_showThumb&id=bdc...

php解析字符串里所有URL地址的方法

本文实例讲述了php解析字符串里所有URL地址的方法。分享给大家供大家参考。具体如下: <?php // $html = the html on the page //...