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修改session_id示例代码

复制代码 代码如下: if(isset($_GET["se"])){ $se = $_GET["se"]; }else{ return; } if(!empty($se)){ echo(...

PHP 作用域解析运算符(::)

Scope Resolution Operator (::) 今天 看joomla源码的时候,才意识到。原来这个操作符还可以访问类的非静态方法啊。真的让我吃惊不好。一直以为作用域解析运算...

利用PHP访问带有密码的Redis方法示例

一、首先设置Redis密码,以提供远程登陆 打开redis.conf配置文件,找到requirepass,然后修改如下: requirepass yourpassword you...

CodeIgniter php mvc框架 中国网站

我们很高兴的宣布 CodeIgniter 1.6.2 版正式发布。本次发布包括超过 29 个 BUG 修复和&nbs...

php中配置文件操作 如config.php文件的读取修改等操作

复制代码 代码如下: <?php $name="admin";//kkkk $bb='234'; $db=4561321; $kkk="admin"; ?> 函数定义: 配...