Lab #2 - Form input using PHP

CS 183 - Hypermedia and the Web

The goal of this assignment is to understand how to use PHP to read and process input generated by an HTML form. For this assignment, must must use the following HTML form (with associated PHP). (Store as form.php).

The example HTML form and PHP handling code shown in class can be found here (use the browser's view source to see both):

The form has input fields for 4 distinct items, their prices and quantities, and a sales tax rate for the order. Note that the original form given out for the assignment had a few errors, and so we recommend using the new form given above.

Additionally, the new form shows how to submit the form values to PHP code that is located in the same file. This is useful for the error checking part of the assignment, where you need to re-display the form in the event of an error.

Your script must be able to process the values and provide an invoice page in HTML as output. Note that you will have to modify the form action to point to the PHP script you create as your answer to this assignment. The invoice output must contain the following:

Please note the following rules to be considered regarding empty fields:

For submission please email Sasha [at] cse [dot] ucsc [dot] edu your php script and a URL to your copy of the form that will trigger your script.

Last modified: 1/30/2004