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-app开发接口加密详解

自己平时工作中用到的一套接口加密规则,记录下来以后用: /** inc 解析接口 客户端接口传输规则: 1.用cmd参数(base64)来动态调用不同的接口,接口地址统一为 htt...

php抽象类用法实例分析

本文实例讲述了php抽象类用法。分享给大家供大家参考。具体如下: <?php /* * abstract * 抽象类: * 1、至少有一个抽象方法(没有具体实现的...

PHP的CURL方法curl_setopt()函数案例介绍(抓取网页,POST数据)

通过curl_setopt()函数可以方便快捷的抓取网页(采集很方便大笑),curl_setopt 是PHP的一个扩展库      使用条件:需...

Ping服务的php实现方法,让网站快速被收录

这篇文章继续说说这个ping服务的问题,首先归纳和总结以下资料: 【1】手动Ping服务地址: Baidu(百度)地址: http://ping.baidu.com/ping.html...

php自动加载方式集合

php加载文件方式: 1、include,include_once,requice,requice_one常规加载 2、__autoload() 3、spl_autoload_regis...