php 清除網(wǎng)頁病毒的方法
更新時間:2008年12月05日 00:02:23 作者:
好像是進行一些替換操作,大家可以測試
<?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)文章
Windows2003下php5.4安裝配置教程(Apache2.4)
這篇文章主要為大家詳細(xì)介紹了在Windows2003下Apache2.4與php5.4配置教程,感興趣的小伙伴們可以參考一下2016-06-06PHP開發(fā)中常見的安全問題詳解和解決方法(如Sql注入、CSRF、Xss、CC等)
這篇文章主要介紹了PHP開發(fā)中常見的安全問題詳解和解決方法,詳細(xì)介紹了例如Sql注入、CSRF、Xss、CC等攻擊手段的背景知識以及解決方法,需要的朋友可以參考下2014-04-04