請問要觸發(fā)這個file_get_content 給一下解題思路也好....
問題描述
<?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ā)的一個題目,因為PHP學(xué)習(xí)還沒有那么深入,所以希望能有一個解題思路
問題解答
回答1:問題不夠詳情。
file_get_contents() 函數(shù)把整個文件讀入一個字符串中。
這個可以抓取數(shù)據(jù),不過現(xiàn)在curl的功能更好。
相關(guān)文章:
1. node.js - mysql如何通過knex查詢今天和七天內(nèi)的匯總數(shù)據(jù)2. shell - Update query wrong in MySQL3. javascript - 用jsonp抓取qq音樂總是說回調(diào)函數(shù)沒有定義4. mysql 插入數(shù)值到特定的列一直失敗5. mysql 怎么做到update只更新一行數(shù)據(jù)?6. javascript - 新浪微博網(wǎng)頁版的字?jǐn)?shù)限制是怎么做的7. 怎么在網(wǎng)頁中設(shè)置圖片進(jìn)行左右滑動8. 360瀏覽器與IE瀏覽器有何區(qū)別???9. sublime可以用其他編譯器替換嗎?10. python - 在使用Pycharm時經(jīng)常看到如下的樣式,小括號里紅色的部分是什么意思呢?
