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给图片添加文字水印方法汇总

1: 面向过程的编写方法 //指定图片路径 $src = '001.png'; //获取图片信息 $info = getimagesize($src); //获取图片扩展名 $typ...

php银联网页支付实现方法

本文实例讲述了php银联网页支付实现方法。分享给大家供大家参考。具体分析如下: 这里介绍的银联WAP支付功能,仅限消费功能。 1. PHP代码如下: 复制代码 代码如下:<?...

php校验公钥是否可用的实例方法

ssh如何利用RSA公钥进行远程登录验证 1、本地机器生成密钥 $ssh-keygen -t rsa 生成基于ssh协议第二版密钥,如果还是用rsa1,该升级了。 2、复制生...

PHP在引号前面添加反斜杠(PHP去除反斜杠)

一般空间商提供的服务器空间默认PHP 指令 magic_quotes_gpc是on的,也就是打开的。这时候就可以用stripslashes() 函数删除自动添加的反斜杠。用法就是:比如包...

php限制ip地址范围的方法

本文实例讲述了php限制ip地址范围的方法。分享给大家供大家参考。具体如下: 只有在限定范围内的ip地址才能访问 function get_real_ipaddress() { i...