Project #2: Forms and CGI


Due Date: Tuesday, April 27th, 1999

This assignment probably shouldn't take you very long at all. Since we probably don't have time to get into custom CGI scripts at this point, it is a simple assignment to make use of forms to call preexisting CGI scripts.

The project takes two parts, and is due two weeks from the release date. I suggest you start it early, though, since the next project will be assigned before this one comes due.

The first part is to write an HTML page containing a form that allows the user to enter a phrase to search for, using Yahoo's Advanced Search. Figure out the script name and the parameters the form must have from the Yahoo Advanced Search page, http://search.yahoo.com/search/options. Hint: the pathname in the form tag for the ACTION works the same as a regular link, in terms of being a relative vs. absolute URL.

Most of what you need will already be there in the source. In order that you understand a little more about what's going on, however, you have to make the following changes in the HTML on your page.

  1. First of all, make it more readable! The form on this page is all smashed onto a couple lines. Use sensible indenting and whitespace to make a more viewable HTML source.
  2. Label the text input as the phrase to search for, in case the user doesn't know.
  3. Change the value of the phrase to search for to something else for a default (e.g., "Fisher-Price people").
  4. For the radio buttons, change which one is prechecked.
  5. For the selections -- "new listings added during the past ___" and "after the first result page, display ___ matches per page" -- note that these are numeric inputs. Try changing the number choices to numbers not on the list. The script at the other end is smart enough to understand this! For both of these, change the default values, and add three more.

For the second part of the project, repeat this process with another page of your choice that calls a CGI script. Make a form that calls it yourself, changing as many options and defaults as you can. This can be on the same page as the first one if you clearly delineate them.

For this one, you must submit the URL of the original page that calls the form, so that I can see you have made the changes that demonstrate your understanding of the process. For both, submit the URL of your page that contains the forms.

Notes

I did this assignment in half an hour, and I knew nothing about forms. But I know a lot more now. You shouldn't find it that difficult. As always, for questions, first check the web page to see if I have answered it there, then contact me at wyvern@cs.umbc.edu.