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 whois查询API制作方法

这里我们从万网或新网的数据接口取得数据,透过php的简单文本处理再输出。 复制代码 代码如下: <php? $domain = $_GET['q']; preg_match("|...

php判断两个日期之间相差多少个月份的方法

本文实例讲述了php判断两个日期之间相差多少个月份的方法。分享给大家供大家参考。具体实现方法如下: /** * @author injection(injection.mail@g...

用PHP实现图象锐化代码

<?   //读取图像的类型     //1 = GIF, 2 = JPG, 3...

PHP 如何利用phpexcel导入数据库

废话不多说,直接上代码吧复制代码 代码如下:<?php error_reporting(E_ALL); //开启错误 set_time_limit(0); //脚本不超时 date...

PHP CURL模拟GET及POST函数代码

复制代码 代码如下:<?php function vcurl($url, $post = '', $cookie = '', $cookiejar = '', $referer =...