請(qǐng)問(wèn)要觸發(fā)這個(gè)file_get_content 給一下解題思路也好....
問(wèn)題描述
<?php
highlight_file(__FILE__);
error_reporting(0);
class Game{
public $username;
public $password;
public $choice;
public $register;
public $file;
public $filename;
public $content;
public function __construct()
{
$this->username='user';
$this->password='user';
}
public function __wakeup(){
if(($this->register)==="admin"){
$this->choice=new login($this->file,$this->filename,$this->content);
}else{
$this->choice = new register();
}
}
public function __destruct() {
$this->choice->checking($this->username,$this->password);
}
}
class login{
public $file;
public $filename;
public $content;
public function __construct($file,$filename,$content)
{
$this->file=$file;
$this->filename=$filename;
$this->content=$content;
}
public function checking($username,$password)
{
if($username==='admin'&&$password==='admin'){
$this->file->open($this->filename,$this->content);
die('login success you can to open shell file!');
}
}
}
class register{
public function checking($username,$password)
{
if($username==='admin'&&$password==='admin'){
die('success register admin');
}else{
die('please register admin ');
}
}
}
class Open{
function open($filename, $content){
echo file_get_contents($filename);
}
}
@unserialize(base64_decode($_POST['unser']));
}
這是老師發(fā)的一個(gè)題目,因?yàn)镻HP學(xué)習(xí)還沒(méi)有那么深入,所以希望能有一個(gè)解題思路
問(wèn)題解答
回答1:問(wèn)題不夠詳情。
file_get_contents() 函數(shù)把整個(gè)文件讀入一個(gè)字符串中。
這個(gè)可以抓取數(shù)據(jù),不過(guò)現(xiàn)在curl的功能更好。
相關(guān)文章:
1. 如何設(shè)置一個(gè)無(wú)限循環(huán)并打破它。(Java線(xiàn)程)2. 網(wǎng)頁(yè)爬蟲(chóng) - 如何使用使用java抓取信息并制作一個(gè)排名系統(tǒng)?3. mysql - 在log日志中已知用戶(hù)的某一步操作,如何獲取其上一步操作?4. php對(duì)mysql提取數(shù)據(jù)那種速度更快5. shell - mysql更新錯(cuò)誤6. javascript - sublime快鍵鍵問(wèn)題7. javascript - immutable配合react提升性能?8. python小白 自學(xué)看書(shū)遇到看不懂的地方9. macos - 如何徹底刪除mac自帶的apache和php10. DADB.class.php文件的代碼怎么寫(xiě)

網(wǎng)公網(wǎng)安備