&1", $output); if ($_MGM['debug']) { echo "Output: \n"; } $foundReply = false; $status = 0; foreach ($output as $line) { if ($_MGM['debug']) { echo $line."\n"; } if ($foundReply && $status==0) { if (strpos($line, "status: NOERROR")!==false) { $status = 1; } else { $status = 2; } } if (strpos($line, "Reply from update query:")!==false) { $foundReply = true; } } if ($status==1) { echo "\nUpdate Successful"; databaseQuery("UPDATE users SET lastupdate=%s, $dblast=%s WHERE username=%s", $_MGM['time'], $_MGM['ip'], $_MGM['user']['username']); } else { if ($_MGM['debug']) { echo "\nCommand: ".$command."\n"; echo "\nUpdate File:\n"; readfile($updateFile); } echo "\nUpdate Unsuccessful"; } unlink($updateFile); } else { echo "No Update"; } closeDatabase(); ?>