Assigned: Monday, March 23
Due date: Monday, March 30
The aim of this project is to get practice using PHP to process a form.
This project will implement a simple initial shopping interface. The visitor will be invited to select a product to view, and in response will be shown a page about that product. Spend a little time thinking up an enterprise that this would serve, and keep everything consistent with that theme.
Create a single PHP web page named project8.php that has two modes:
The form must use the
POST method of submission, but
the processor may respond also to
(useful for debugging). Remember that
the data from either method of submission.
Be sure to process the form data in a way that is not vulnerable to errors or exploits from bogus requests. (An example would be a request for a product that does not exist.) The response to bogus data can simply be to re-present the form. (Because honest submissions from your form will always have valid data, you don't need to dignify dishonest requests with any special treatment.)
Hint: a simple and scalable way to implement the response is to create
separate files with the HTML body content for each product, and use
include function to insert the file for the
chosen product into the body of the response.
Note: Your project page must pass the W3C validator with no more than the unavoidable warning about the experimental HTML5 conformance checker.