Using cgi for query parsing