CSCI.4220 Network Programming
Fall, 2006, Lab 6 PHP


Redo the project of last week's lab so that the server is written in PHP.

Create an HTML page which displays some information about plants for sale. It should look sort of like this

Item Price Quantity
Rhododendrons $18.50
Tea Roses $6.95
Marigolds $1.29

The page should be in an HTML form which allows the user to place an order for each of the three types of plants. A user can order any amount of any of these. The order should be sent to a PHP program which calculates the cost for each suborder and the total cost of the order and sends this back to the client.

For example, if the user ordered 50 rhododendrons, 0 tea roses, and 100 marigolds, the returning web page would look like this

Item Price Quantity Total
Rhododendrons $18.50 50 $925.00
Tea Roses $6.95 0 $0.00
Marigolds $1.29 100 $129.00
Total     $1,054.00

A real application would have to do lots of error handling, such as empty strings; but you do not have to worry about this; you can assume that the user will enter valid numbers for all three fields.

If you don't have PHP installed on your laptop, you can do this on monica, ashley, or mary-kate.

Two good resources for PHP are the W3 Schools at http://www.w3schools.com/php/default.asp and the official PHP web site at http://www.php.net/manual/en/