COM372: Assignment 2
The Grocery List
given 1/26 | due 2/10
Purpose To practice a few elements from chapters 1-3; embedding PHP, using form elements to send information, retrieving and using form information, loops and control structures, and writing text files.
The assignment: Time to buy some groceries! Create a prototype shopping list form for at least 2 major group of foods (veggies, snacks, deserts, etc.) and at least 3 items in each group (use <fieldset> and <legend>: to set off and identify each group.) For each item, specify the item name and a pre-determined unit (e.g., apples= bag; milk=quart) and a text box for quantities.
The form will call a results page to create a shopping list. Because items in a grocery store are generally located in groups, you are to list the groups (but only if there are any items in them) and present an alphabetized listing of items and quantities (e.g., milk, quarts—4) within each group.
Make sure that your results page has two style sheets, one for the screen and a separate style sheet for print. (Your instructor will provide individual assistance for students lacking CSS background).
Include php comments to explain each section and any important logical details.
Grading: This assignment is worth 5 points. Each of the following are required; each is worth 1 point. One point will be deducted if the assignment is not done by the due date.
- 1—HTML form with all elements working correctly to send information
- 2—PHP page able to read and display form values (with PHP commenting)
- 3—form output arranged by group (above), and alphabetically within groups
- 4—Separate (minimalist) style sheets for screen and print
- 5—Completed on time, on the server, linked from home page with link back to home page.