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 病毒

相关文章

PHPTree——php快速生成无限级分类

PHPTree——php快速生成无限级分类

它就是PHPTree。 git地址:https://git.oschina.net/jiusem/PHPTree.git 或从【宜配屋www.yipeiwu.com】下载 https:/...

最令PHP初学者们头痛的十四个问题

【1】页面之间无法传递变量 get,post,session在最新的PHP版本中自动全局变量是关闭的,所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$_PO...

PHP读取文件内容后清空文件示例代码

复制代码 代码如下: $fh = fopen($path, "r+"); if( flock($fh, LOCK_EX) ){//加写锁 $old_content=json_decode...

thinkphp中连接oracle时封装方法无法用的解决办法

thinkphp中连接oracle时封装方法无法用的解决办法

最近收集了一些关于THinkPHP连接Oracle数据库的问题,有很多朋友按照连接mysql的方法来操作,导致有一些方法在Oreale中无法正常使用。比如说:findAll,Select...

php实现的简易扫雷游戏实例

本文实例讲述了php实现的简易扫雷游戏。分享给大家供大家参考。具体如下: <?php $init = $_POST["init"];//game restart $...