CPSCI 107: Applications, Implications, and Issues

Homework 12

due: March 31, 2006


Hypertext Forms

Create a form so that someone visiting your warp website can send you a message without knowing your email address.

Your form will use the CGI program located at the following URL:
    http://www.cs.hamilton.edu/~brosmait/cgi-bin/warp-contact.cgi

Details about how to use this program are given in the next section.

The warp-contact.cgi API

An API is an Application Programming Interface. Roughly, an interface is protocol for communicating with a program you want to use. In order for the program to do what you want, it expects you to pass data to it in a certain way; the API tells you how to do this.

The warp-contact.cgi API is very simple. It expects to see all of the following fields as the result of a post method. (Note: The name of each field is case-sensitive).

sendto
A two-character code specifying where the message will be sent. (I'll tell you the legal codes in class, or you can ask me by email if you want to get started on this homework early.)
name
The form user's name.
email
The form user's email address.
subject
The Subject field for the contact email which will be sent to you.
message
The form user's message to you.

Any other fields on your form are ignored.

Functionality

The warp-contact.cgi program will read the submitted data from your form and generate a response HTML page that will be displayed in your browser. The response page will indicate success or that a problem occurred. If it indicates success, an email was sent to your hamilton.edu address containing the information supplied by the form user; if it indicates that a problem occurred, it will contain a detailed error message (or messages) explaining the problem.

Error Messages

There are two types of error messages.

  1. API errors: These are your errors, i.e., problems caused by the data posted by your form. (An example: a missing email field; this could be caused by a typo on your form (e.g., name="emial") or if you forgot to include the field on your form).
  2. User errors: These are caused by the form user not supplying a value for one of your form fields.

Form Design

Use the accessibility features we've discussed in class in creating your form (e.g., all inputs should be labeled). Use whatever form controls make sense (e.g., you might want to make the ‘subject’ field a selection box or radio buttons—or even be hidden; this would be useful if you want to filter your incoming email according to its subject field).

Feel free to make multiple form pages if you want to try out different options.

Submission

Create your contact form webpage in your hw directory. Put a link to it on your warp homepage.

[ Return to the CPSCI 107 homepage ]

Brian J. Rosmaita <contact me>
This page was last modified Monday, 13 March 2006 at 17:34 UTC.
Valid XHTML 1.0 ! Valid Cascading Style Sheets! This page is in AAA Conformance with the Web Content Accessibility Guidelines