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连接mssql:pdo odbc sql server

只有一个php_pdo_odbc.dll。 so~最新最好的php连接mssql方法应该是这样: 复制代码 代码如下: <?php $cnx = new PDO("odbc:Dri...

WIN8.1下搭建PHP5.6环境

WIN8.1下搭建PHP5.6环境

  第一次接触php是在2014-5月份左右,当时是自己的主攻方向是C#,对php比较排斥, 其中很多一部分原因,就是PHP的断点调试一直无法配置成功,用echo打印日志的方式排错,使得...

使用PHP获取网络文件的实现代码

复制代码 代码如下:<?php //设置我们将要使用的文件 $srcurl = "http://localhost/index.php"; $tempfilename = "tem...

php中get_cfg_var()和ini_get()的用法及区别

本文实例讲述了php中get_cfg_var()和ini_get()的用法及区别。分享给大家供大家参考。具体分析如下: php里get_cfg_var()和ini_get()都是取得配置...

FCKeditor的安装(PHP)

1.下载新最版的FCKEditor,解压 2.删除/FCKeditor/目录下除fckconfig.js, fckeditor.js, fckstyles.xml,&...