![]() |
Exploiting the Information World
|
|
For each exercise that you complete during class you must make record your results to show the TA (or show the TA your screen). If you don't have time to complete everything during class you must record your results and give them to the TA by the next class meeting. |
Develop a CGI application that allows users to order products by typing in the name of the product and pressing a submit button. Your CGI program should then add the new item to a list of items already ordered by the user (using the same method), and send back another copy of the form.
You should use hidden fields to propogate the state of the "shopping cart" from one invocation of your CGI to the next. In other words, when a user submits the form, the new item is added to an existing list of items that came from a hidden field. The new document generated by the CGI should include the same form, but now the value of the hidden field should reflect the additional item.
Your web page should also have a "Order" button that runs a CGI program that generates an HTML document containing the contents of the shopping cart (it gets the value of the hidden field and sends it back to the user in a nice format). This should be provided as a seperated function (I don't want to see the shopping cart on every page - only when I press the "Order" button").