不过如此
<?php
error_reporting(0);
$text = $_GET["text"];
$file = $_GET["file"];
if(isset($text)&&(file_get_contents($text,'r')==="I have a dream")){
echo "<br><h1>".file_get_contents($text,'r')."</h1></br>";
if(preg_match("/flag/",$file)){
die("Not now!");
}
include($file); //next.php
}
else{
highlight_file(__FILE__);
}
?>
考察点:php伪协议。参考链接。
首先判断text是否存在,file_get_contents为可读方式读取text值,并判断是否等于给定条件。伪协议data来写入值。input照理说也可以,但题目未能实现。
?text=data://text/plain,