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 xml 入门学习资料

起因:   今天做项目时遇到一个问题:需要动态更新主页上的图片,以示本站不是做完了就算了,是有人一直在维护。好了,需求有了,如何实现?!   我的想法如下:   图片存放位置:放在一个文...

php中截取中文字符串的代码小结

字符串截取是一个非常常见的编程任务,而往往带中文的字符串截取会经常用到。虽然不难,但是自己写函数实现又耗费时间,这里介绍一个比较好用的字符串截取函数,能够胜任基本的需求了。 1. 截取G...

php实现用已经过去多长时间的方式显示时间

本文实例讲述了php用已经过去多长时间的方式显示时间的方法。分享给大家供大家参考。具体如下: 这里以一种可读性比较好的方式显示已经过去多长时间,比如:距离现在10秒,距离现在1天等等。...

php ftp文件上传函数(基础版)

复制代码 代码如下:<?php // 定义变量 $local_file = 'local.zip'; $server_file = 'server.zip'; // 连接FTP服务...

Discuz! 5.0.0论坛程序中加入一段js代码,让会员点击下载附件前自动弹出提示窗口

你需要修改attachment.php文件 在根目录下  在$attachexists = $ispaid = FALSE;下...