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基于openssl实现的非对称加密操作示例

本文实例讲述了PHP基于openssl实现的非对称加密操作。分享给大家供大家参考,具体如下: 使用非对称加密主要是借助openssl的公钥和私钥,用公钥加密私钥解密,或者私钥加密公钥解密...

PHP连接Access数据库的方法小结

PHP代码: 需要注意php获取路径用的是realpath 复制代码 代码如下: <?php $connstr="DRIVER={Microsoft Access Driver (...

php使用socket调用http和smtp协议实例小结

本文实例讲述了php使用socket调用http和smtp协议。分享给大家供大家参考,具体如下: socket发送HTTP请求 http协议请求报文格式 get ## 请求方法 请求...

PHP 数据结构 算法描述 冒泡排序 bubble sort

复制代码 代码如下: <?php /** * 冒泡排序 bubble sort * * 原理:多次循环进行比较,每次比较时将最大数移动到最上面。每次循环时,找出剩余变量里的最大值,...

PHP入门教程之数学运算技巧总结

本文实例讲述了PHP入门教程之数学运算技巧。分享给大家供大家参考,具体如下: Demo1.php <?php // $a = '5'; // $b = 7+$a; //...