请问要触发这个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']));
}
这是老师发的一个题目,因为PHP学习还没有那么深入,所以希望能有一个解题思路
问题解答
回答1:问题不够详情。
file_get_contents() 函数把整个文件读入一个字符串中。
这个可以抓取数据,不过现在curl的功能更好。
相关文章:
1. Android-Studio 新建项目 Missing styles2. 如何解决docker宿主机无法访问容器中的服务?3. thinkphp6使用验证器 信息如何输出到前端页面4. 老师,flex-shrink: 1; 按视频操作,不会自动缩放5. php为什么是源程序显示?6. javascript - 我这个页面的main的盒模型为什么把header的模型空间也包括了。7. golang - 用IDE看docker源码时的小问题8. docker容器呢SSH为什么连不通呢?9. debian - docker依赖的aufs-tools源码哪里可以找到啊?10. 在windows下安装docker Toolbox 启动Docker Quickstart Terminal 失败!

网公网安备