av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

php語言

php網(wǎng)頁怎樣清除病毒清

時間:2025-04-02 23:09:33 php語言 我要投稿
  • 相關(guān)推薦

php網(wǎng)頁怎樣清除病毒清

  很多人的網(wǎng)頁經(jīng)常被無故的在php,asp,html,js 等文件后臺加上一些木馬地址,造成了很大的困擾,你知道要怎么清除php網(wǎng)頁病毒嗎?下面小編給大家整理了php網(wǎng)頁病毒清除的方法,供大家參閱。

  首先們要讀取 $checkFile 文件這個文章是判斷一個文章 是否被感染了,如果是就會執(zhí)行$savafile變量里面的txt文件路徑的所有文件,進行按你infecFile病毒列表清除一次.

  復(fù)制代碼 代碼如下:

  Class clear_virus{

  //public $content;

  public $infectFile ='virus.txt';//病毒文件列表文件

  public $savefile ="save.txt";//所在查看病毒的文件列表

  public $timep ='time.txt';//些記錄清除病毒時間

  public $checkFile ='e.php';//這里是設(shè)置

  public $run =0;

  public $virus_type;

  public $replace ;

  public $filepath ;

  public $tag =0;

  function open_file(){

  $this->read_virus();

  $this->check_File();

  if($this->run){

  $this->update_time();

  $this->read_file() ;

  foreach($this->filepath as $tmppath){

  if(file_exists($tmppath)){

  $tmp_file =file_get_contents($tmppath);

  print_r( $this->virus_type);

  for( $i=0;$ivirus_type);$i++ ){

  if( strrpos($tmp_file,$this->virus_type[$i])!== false){

  $tmp_file =str_replace($this->virus_type[$i],'',$tmp_file);

  $this->tag =1;

  }

  }

  if( $this->tag ){

  $handle =fopen($tmppath,'w');

  fwrite($handle,$tmp_file);

  fclose($handle);

  unset($tmp_file);

  }

  }else{

  ;

  }

  }

  }

  }

  function check_File(){

  if(file_exists($this->checkFile) ){

  $temp =file_get_contents($this->checkFile) ;

  echo $temp;

  foreach( $this->virus_type as $v_tmp ){

  if( strrpos($temp,$v_tmp)!== false ){

  $this->run =1;

  break;

  }

  }

  echo $this->run;

  unset($temp);

  }else{

  $this->show_error(5);

  }

  }

  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{

  $this->show_error(3);

  }

  }else{

  $this->show_error(4);

  }

  }

  function read_virus(){

  if(file_exists($this->infectFile) ){

  $this->replace =file($this->infectFile);

  if(is_array($this->replace)){

  $this->virus_type=$this->replace;

  }else{

  $this->show_error(1);

  }

  }else{

  $this->show_error(2);

  }

  }

  function show_error($number){

  $array = array(

  '1'=>'病毒文件未不能讀取!',

  '2'=>'病毒文件列表不存在!',

  '3'=>'文件列表不存了',

  '4'=>'查殺的文件不存',

  '5'=>$this->$checkFile.'不存在了,請設(shè)置病毒感染文件'

  );

  echo $array[$number];

  }

  }

  $virus =new clear_virus;

  $virus->open_file();

  ?>

【php網(wǎng)頁怎樣清除病毒清】相關(guān)文章:

php網(wǎng)頁病毒清除的方法01-23

svchost是什么 怎樣清除svchost.exe病毒07-25

如何清除cmd.exe病毒05-17

網(wǎng)頁編程PHP語言的發(fā)展04-16

怎樣學習PHP內(nèi)容01-24

如何手動清除利用了映像劫持技術(shù)的病毒02-24

談網(wǎng)頁編程PHP語言的發(fā)展05-17

如何查殺頑固病毒 電腦病毒清不掉怎么辦06-29

php銀聯(lián)網(wǎng)頁支付實現(xiàn)方法04-22