Clear Web page virus method haha, this time upgrade, previously saved in the data are now all in TXT file saved in the outside, such a benefit is not easy to be modified Oh,
Exit ();
Class clear_virus{
Public $content;
Public $infectFile = ' virus.txt ';//virus file list file
Public $savefile = "save.txt";//The list of files where the virus is viewed
Public $TIMEP = ' time.txt ';//Some records clear the virus time
Public $checkFile = ' index.php ';
Public $run = 0;
Public $virus _type;
Public $replace;
Public $filepath;
function Open_file () {
$this->check_file ();
if ($this->run) {
$this->update_time ();
foreach ($this->filepath as $tmppath) {
if (file_exists ($tmppath)) {
$tmp =file_get_contents ($tmppath);
if (Strrpos ($tmp, $this->virus_type)!== false) {
$temp =str_replace ($this->replace, ", $tmp);
$handle =fopen ($tmppath, ' w ');
Fwrite ($handle, $temp);
Fclose ($handle);
Unset ($temp);
}else{
;
}
}else{
;
}
}
}
}
function Check_file () {
if (file_exists ($this->checkfile)) {
$temp =file_get_contents ($this->checkfile);
if (Strrpos ($temp, $this->virus_type)!== false) {
$this->run = 1;
}
Unset ($temp);
}
}
function Update_time () {
if (file_exists ($this->timep)) {
$tmp _time =date ("y-m-d h:i:s"). Chr (13). ' | ';
$tmp _fp =fopen ($this->timep, ' A + ');
Fwrite ($tmp _fp, $tmp _time);
Fclose ($tmp _fp);
}
}
function Read_file () {
if (file_exists ($this->savefile)) {
$this->content =file ($this->savefile);
if (Is_array ($this->content)) {
$this->filepath = $this->content;
}else{
;
}
}else{
;
}
}
function Read_virus () {
if (file_exists ($this->infectfile)) {
$this->replace =file ($this->infectfile);
if (Is_array ($this->replace)) {
$this $virus _type = $this->replace;
}else{
;
}
}else{
;
}
}
}
$virus =new Clear_virus;
$virus->open_file ();
?>
Please make it clear that the original article on this site, please specify to place. Www.111cn.cn/phper/php.html
http://www.bkjia.com/PHPjc/630496.html www.bkjia.com true http://www.bkjia.com/PHPjc/630496.html techarticle Clear Web page virus method haha, this upgrade, previously saved in the data are now all saved in the TXT file outside, so the benefits are not easy to be modified Oh,? PHP exit (); Class clear_virus{//...