이 file_get_content를 트리거하는 방법에 대한 몇 가지 아이디어를 제공해 주시겠습니까?...
Gsmile10
Gsmile10 2021-03-21 09:45:02
0
1
1148

<?php

highlight_file(__FILE__);

error_reporting(0);

class Game{

    public  $username;

    public  $password;

    public  $choice;

    public $등록;

    공개  $file;

    공개  $filename;

    공개  $content;

    

    공개 함수 __construct()

    {

        $this->username='user' ;

        $this-> 비밀번호='user';

    }

    공개 함수 __wakeup(){

        if(($this->register)==="admin"){

            $this->choice=새 로그인 ($this->file,$this->filename,$this->content);

        }else{

            $this->choice = 새 등록();

        }

    }

공개 함수 __destruct() {

        $this->choice->checking($this->username,$this->password);

    }

}

클래스 로그인{

    공개 $file;

    공개 $filename;

    공개 $content;

    공개 함수 __construct($file,$filename,$content)

    {

        $this->file=$file;

       $ this->filename=$filename;

        $this->content=$content;

    }

    공개 기능 확인($username,$password)

    {

        if($username==='admin '&&$password==='admin'){

            $this->file->open($this->filename,$this->content);

            die('로그인 성공 가능 쉘 파일 열기!');

        }

    }

}

클래스 레지스터{

    공개 기능 검사($username,$password)

    {

        if($username==='admin'&&$ 비밀번호==='admin'){

            die('관리자 등록 성공');

        }else{

            die('관리자를 등록하세요');

        }

    }

}

수업 공개{

    함수 열기($filename, $content){

        echo file_get_contents($filename);

    }

}

@unserialize(base64_decode($_POST['unser']));

}

선생님께서 보내주신 질문입니다. 아직 PHP를 깊게 배워본 적이 없어서 해결할 수 있는 아이디어가 있었으면 좋겠습니다. 문제

Gsmile10
Gsmile10

모든 응답(1)
欧阳

질문의 세부정보가 충분하지 않습니다.

file_get_contents() 함수는 전체 파일을 문자열로 읽어옵니다.

이것은 데이터를 캡처할 수 있지만 이제 컬에는 더 나은 기능이 있습니다.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!