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管理nginx虚拟主机shell脚本实例

本文实例讲述了php管理nginx虚拟主机shell脚本,分享给大家供大家参考。具体分析如下: 使用php作为shell脚本是一件很方便的事情。理所当然,我们可以使用php脚本来管理 n...

php引用地址改变变量值的问题

复制代码 代码如下: <?php $foo = 'Bob'; // 将 'Bob' 赋给 $foo $bar = &$foo; // 通过 $bar 引用 $foo echo $f...

Thinkphp事务操作实例(推荐)

实例如下: //开启mysql事务操作 $model = M(); $model->startTrans(); $flag=false; $deal1 = M('ppdd')-...

Ping服务的php实现方法,让网站快速被收录

这篇文章继续说说这个ping服务的问题,首先归纳和总结以下资料: 【1】手动Ping服务地址: Baidu(百度)地址: http://ping.baidu.com/ping.html...

PHP获取ttf格式文件字体名的方法示例

本文实例讲述了PHP获取ttf格式文件字体名的方法。分享给大家供大家参考,具体如下: <?php $names = GetFontName('c:/windows/fo...