请问要触发这个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. dockerfile - 为什么docker容器启动不了?2. javascript - 学习网页开发,关于head区域一段脚本的疑惑3. javascript - JS设置Video视频对象的currentTime时出现了问题,IE,Edge,火狐,都可以设置,反而chrom却...4. macos - mac下docker如何设置代理5. javascript - 如何获取未来元素的父元素在页面中所有相同元素中是第几个?6. Whitelabel错误页面发生意外错误(类型=未找到,状态= 404)/WEB-INF/views/home.jsp7. 热切期待朱老师的回复,网页视频在线播放器插件配置错误8. mysql - AttributeError: ’module’ object has no attribute ’MatchType’9. javascript - 从mysql获取json数据,前端怎么处理转换解析json类型10. angular.js - ng-grid 和tabset一起用时,grid width默认特别小
