請問要觸發(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. 老師您的微信號是多少?2. node.js - nodejs開發(fā)中常用的連接mysql的庫3. mysql replace 死鎖4. mysql - 字符串根據(jù)字典替換5. 網(wǎng)頁爬蟲 - python 爬取網(wǎng)站 并解析非json內(nèi)容6. 視頻文件不能播放,怎么辦?7. mysql - 分庫分表、分區(qū)、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處8. 請教使用PDO連接MSSQL數(shù)據(jù)庫插入是亂碼問題?9. 雙擊安裝程序,安裝不了10. mysql - 把一個表中的數(shù)據(jù)count更新到另一個表里?
