请问要触发这个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. node.js - nodejs中把热request保存下来,使用JSON.stringify(req)报错,请问怎么解决?2. 在MySQL中新增字段时,报错??3. 老哥们求助啊4. python - 模拟滑动验证码,有源码,求解5. html5 - angularjs中外部模版加载无法使用6. css3 - 请问一下在移动端CSS布局布局中通常需要用到哪些元素,属性?7. npm镜像站全新上线8. javascript - vue-router怎么不能实现跳转呢9. java - 安卓电视盒子取得了root权限但是不能安装第三方应用,请问该怎么办?10. 我的Apache卡在这里不动了怎么办?
