ASSIGNMENT 5 Basic Perl CGI operations Due: Tuesday, Feb 28, 11:59:59 pm Document status: PROVISIONAL -- MAY CHANGE 1. Write a CGI script that detects the HTTP_USER_AGENT and the HTTP_HOST from the server environment. Your script should produce a simple HTML page that indicating whether the user logged on to the page is using either Mozilla/Netscape or Internet Explorer. (Suggestion: Use a simple regular expression match that tests whether the user-agent includes the string 'MSIE'. If not, we assume it's Netscape/Mozilla. You may decide to handle other browsers as well, but this is not a requirement.) (25 pts.) 2. Hidden Fields (25 pts.) Create a cgi script that uses a hidden form field to pass user-supplied data across html pages. The user should be presented with an HTML form page with a field to enter a name and submit button. On submit, another form page must be called up to enter more data of your choice. A text input field and a submit button would suffice. This form page must contain the name entered into the previous form as a hidden field. The submit button shall call up a third page that will display the data entered in both form pages, including the name. The first page may be a static HTML page, the others must be created dynamically by cgi-script(s). 3. Server-side Validation (50 pts.) Create a cgi script that validates form data sent to the server via the HTML form created for assignment 2. The script must check that required data has been submitted and whether the data is of the right kind, as specified below. Required data are: first name (must not be empty), last name (must not be empty), address (must not be empty), city (must not be empty), state (must be a string of two letters, save in upper case), zip (must be a string of five digits), email (a string that must contain one '@' and at least one '.') area of expertise (at least one recognized choice* must have been submitted) (* A 'recognized choice' is one of the values in your form page.) If one or more data fields do not meet the requirements, the form and data must be returned to the user with a message indicating the problem. With the exception of radio and checkbox fields, valid data must appear in the corresponding form fields. Finally, when the data has been validated and found correct, the user must be notified about the acceptance of the data on another HTML page.