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使用缓存即时输出内容(output buffering)的方法

PHP使用缓存即时输出内容(output buffering)的方法。分享给大家供大家参考。具体如下: $buffer = ini_get('output_buffering');...

PHP数据过滤的方法

在指南的开始,我们说过数据过滤在任何语言、任何平台上都是WEB应用安全的基石。这包含检验输入到应用的数据以及从应用输出的数据,而一个好的软件设计可以帮助开发人员做到:确保数据过滤无法被绕...

php array_merge下进行数组合并的代码

如  $array3=array("性别"=>"男","姓名"=>"不是女人");  $array4=array("性别"=>"不知道","长相"=...

php中explode的负数limit用法分析

本文实例讲述了php中explode的负数limit用法。分享给大家供大家参考。具体分析如下: explode -- 使用一个字符串分割另一个字符串,使之成为数组。 参数为: arr...

利用PHPExcel读取Excel的数据和导出数据到Excel

利用PHPExcel读取Excel的数据和导出数据到Excel

PHPExcel是一个PHP类库,用来帮助我们简单、高效实现从Excel读取Excel的数据和导出数据到Excel。也是我们日常开发中,经常会遇到的使用场景。比如有个客户信息表,要批量导...