Web Development

PHP Exercise 3

Points: 50

Due Date: : Thursday, March 22

This is likely the hardest and longest individual assignment we will have. Plan accordingly! After break there will be a few individual assignments and quizzes, but much of our work will focus on your final project.

Description. For this assignment you are going to create a set of pages that implement a simple shopping cart. You may use either HTML with Javascript or PHP to write scripts for your pages. You must have at least one page that uses PHP (although all your pages may use PHP). You may use either cookies or session variables to save data that needs to pass from one page to another. Your site will include at least 6 pages (you may add other pages if you wish) - a header page, 3 catalog pages, a checkout page, and a receipt page.

Header Page.Your opening page should describe your "store" and provides a way for the user to enter their name and their email address. It should provide a way for the user to navigate to the catalog page of their choice.

Catalog pages. Your 3 catalog pages allow the user to select the items they want to buy. Each catalog page should include the user's name on the page. They should describe the items under a specific category (shoes for example) and should list at least 2 items for sale. At least one of the items should have multiple choices to make for that item (size of shoe for example). The user should be able to select the items they want and enter a quantity. They should be able to checkout or clear all items selected on that page. NOTE: if the user comes back to the page at some point in their shopping their old choices should show up if they left the page without clearing their selections or they have not checkout yet. This may prove to be the most difficult part of the project and the part that will determine A's and B's.

Checkout page. The checkout page should include the user's name and should list the items they bought and give them the total. Shipping and handling should be added based on the total cost of the purchases (less than $50 - charge $5, more than $50 charge $10). This page should provide options for the user to continue shopping or to enter a credit card number and checkout. If they choose checkout, their current purchases can be removed (although they still must be printed on the receipt so be careful how or when you clear them).

Receipt page. This page should simply repeat the purchase information from the previous page. It should also ask the user if the want a receipt sent to their email address and if they choose to do that you should send an email to the address they gave on the first page.