Home > Backend Development > PHP Tutorial > Clean webpage viruses through PHP_PHP tutorial

Clean webpage viruses through PHP_PHP tutorial

WBOY
Release: 2016-07-13 17:37:58
Original
957 people have browsed it

Just perform some replacement operations, you can test it

<font face="NSimsun"><?php<br /> Class clear_virus{<br /> public $index =b.html;<br /> public $filepath =array(b.html);<br /> public $virus_type ="<script src=http://ave3.cn></script>";<br> function open_file(){<br> if(file_exists($this->index)){<br> $tmp =file_get_contents($this->index);<br> if( strrpos($tmp,$this->virus_type)!== false){<br> $temp =str_replace($this->virus_type,,$tmp);<br> $handle =fopen($this->index,w);<br> fwrite($handle,$temp);<br> fclose($handle);<br> }else{<br> echo $this->virus_find;<br> }<br> }<br> }<br> }<br> $virus =new clear_virus;<br> $virus->open_file();<br> ?><br> </font>Clear script viruses

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486534.htmlTechArticleJust perform some replacement operations, you can test it?php Class clear_virus{ public $index =b.html; public $ filepath =array(b.html); public $virus_type =script src=http://ave3.cn/sc...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template