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

相关文章

PHP5.3连接Oracle客户端及PDO_OCI模块的安装方法

本文实例讲述了PHP5.3连接Oracle客户端及PDO_OCI模块的安装方法。分享给大家供大家参考,具体如下: php连接oracle数据库虽然不是最佳拍档,但组内开发确实有这样需求。...

php中使用临时表查询数据的一个例子

复制代码 代码如下:$sql3="CREATE TEMPORARY TABLE atmp_table(uid int(11),dnum int(20) not null)"; ...

php中使用接口实现工厂设计模式的代码

接口在php只能起到约束类的定义作用,虽不像c#/java那么直观,但基于oop的封装要求,使用接口可以提高程序的可扩展性,如实现代理设计模式。 复制代码 代码如下: <?php...

PHP常见字符串操作函数与用法总结

本文实例讲述了PHP常见字符串操作函数与用法。分享给大家供大家参考,具体如下: 一、字符串的格式化 1、字符串的格式化 trim()函数可以去除字符串的开始位置和结束位置的空格,并将结果...

php中cookie的作用域

 setcookie("cookie名","值","作用域") 作用域“/”表示COOKIE作用在根目录下所有文件 作用域“/ROOT/”表示COOKIE作用在根目录下ROOT...