0) { if (($in_string != "quit") && ($in_string != "")) { // get file to be included $inc = substr($in_string,0,strpos($in_string," ")); $remainder = substr($in_string,strpos($in_string," ")+1); // parse function from command $cmd = substr($remainder,0,strpos($remainder," ")); // parse parameters from remainder of command $preparm = substr($remainder,strpos($remainder," ")+1); $parm = explode(" ",$preparm); // check for existance of function. If exists call it if (!function_exists($cmd)) { eval("include_once(\"" . $inc . "\");"); } if (function_exists($cmd)) { $result = call_user_func_array($cmd, $parm); if (strpos($result,"\n") != 0) { fputs(STDOUT, $result); } else { fputs(STDOUT, $result . "\n"); } } else { fputs(STDOUT, "ERROR: Function does not exist\n"); } }elseif ($in_string == "quit") { break; }else { fputs(STDOUT, "ERROR: Problems with input\n"); } }else { fputs(STDOUT, "ERROR: Input expected\n"); } } ?>