Type 'help' to see a list of commands. ");
}
if (file_get_contents("pwd.txt") == NULL) {
file_put_contents("pwd.txt", "/");
}
if(!opendir("fileroot")){
if(!mkdir("fileroot")){
echo "Error creating directory.No permissions?";
exit(0);
}
}
?>
frame
", FILE_APPEND);
$output_str = file_get_contents("recent.txt");
echo $output_str;
$commands = explode(" ", $_POST['command']);
if ($_POST['command'] == NULL) {
echo "";
exit(0);
} else if ($_POST['command'] == "pwd") {
file_put_contents("recent.txt", $pwd . " ", FILE_APPEND);
} else if ($_POST['command'] == "clear") {
file_put_contents("recent.txt", "");
} else if ($commands[0] == "help") {
$help = file_get_contents("static/terminal.php/help.txt");
if (sizeof($commands) == 1) {
file_put_contents("recent.txt", $help, FILE_APPEND);
} else if (sizeof($commands) == 2 && file_get_contents("static/help/$commands[1].txt") != NULL) {
file_put_contents("recent.txt", file_get_contents("static/help/$commands[1].txt"), FILE_APPEND);
} else {
file_put_contents("recent.txt", "Unknown command. ", FILE_APPEND);
}
} else {
file_put_contents("recent.txt", "Unknown command. ", FILE_APPEND);
}
echo "";
?>