| =htmlspecialchars($result['docid'], ENT_COMPAT | ENT_HTML401, 'UTF-8', true)?> | =htmlspecialchars($result['email'], ENT_COMPAT | ENT_HTML401, 'UTF-8', true)?> | =$level?> | 
| =htmlspecialchars($result['docid'], ENT_COMPAT | ENT_HTML401, 'UTF-8', true)?> | =htmlspecialchars($result['key'], ENT_COMPAT | ENT_HTML401, 'UTF-8', true)?> | =str_replace("\n", " ", htmlspecialchars($result['message'], ENT_COMPAT | ENT_HTML401, 'UTF-8', true))?> | 
 "success", "results" => array());
			while ($result = databaseFetchAssoc($results)) {
				$response['results'][] = $result;
			}
			header("content-type: application/json");
			echo json_encode($response);
		}
		if ($_MGM['path'][2]=="find") {
			$results = databaseQuery("SELECT * FROM {$_MGM['DBPrefix']}responses WHERE key LIKE %s OR docid=%s", "%".$_REQUEST['key']."%", $_REQUEST['key']);
			$response = array("type" => "success", "results" => array());
			while ($result = databaseFetchAssoc($results)) {
				$response['results'][] = $result;
			}
			header("content-type: application/json");
			echo json_encode($response);
		}
		if ($_MGM['path'][2]=="get-all") {
			$results = databaseQuery("SELECT * FROM {$_MGM['DBPrefix']}responses");
			$response = array("type" => "success", "results" => array());
			while ($result = databaseFetchAssoc($results)) {
				$response['results'][] = $result;
			}
			header("content-type: application/json");
			echo json_encode($response);
		}
	}
	exit();
}
$response = array("type" => "failure", "error" => "Not a valid request.");
header("content-type: application/json");
echo json_encode($response);
exit();