This assignment builds upon the CGI program from HW1 to complete a full-featured email address search engine (similar to many found on the Web). In addition to the features described in HW1, your program must (1) produce a more readable page, (2) accept first and last names as search strings, and (3) handle special characters. It is strongly recommended that you complete one modification/addition before beginning the next.
For example, a search for "Dave" using the faculty email database might produce the following output:
Content-Type: text/html Math/CS Email Search Search results for: Dave
Davender Malik: malik@creighton.edu
Dave Reed: davereed@creighton.edu
Recall that the HTTP POST method encodes all form elements in a single string, which is then passed to the CGI program as input. Thus, the Web page on the left might produce the string on the right:
Hint 1: The task of translating a single hex character to its decimal equivalent can be simplified using strings. By storing all of the hex digits in a string (with index corresponding to value), the value of a hex digit can be determined using find. For example,
Hint 2: To convert a two-digit hex number to decimal, simply multiply the first digit by 16 and add the second digit. For example,
Hint 3: To convert an ASCII code into its corresponding character, simply cast that code to a char. For example,