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图片的二进制转换实现方法。分享给大家供大家参考。具体实现方法如下: 这里我们是在上传文件时把上传的文件转换成二进制然后保存到数据的字段中去,下次读读出我们也用同样的方...

php实现通过cookie换肤的方法

本文实例讲述了php实现通过cookie换肤的方法。分享给大家供大家参考。具体如下: saveStyleSheet.php页面如下: <?php function s...

浅析PHP的ASCII码转换类

复制代码 代码如下:class ascii{function decode($str){    preg_match_all( "/(d{2,5})/",...

php字符集转换

PHP通过iconv将字符串从GBK转换为UTF8字符集。 1. iconv()介绍 iconv函数可以将一种已知的字符集文件转换成另一种已知的字符集文件。例如:从GB2312转换为U...

php版微信公众号接口实现发红包的方法

php版微信公众号接口实现发红包的方法

本文实例讲述了php版微信公众号接口实现发红包的方法。分享给大家供大家参考,具体如下: 最近接到一个任务,需要用微信来给用户自动发红包。要完成这个任务需要这么已经一些物料 微信商户号,已...