Now that the database has been created it is time to consider the HTML forms that will be needed to interface with it. Before we consider the customer orders we first need to get some pizzas into the database!
The staff at Pizza Kitchen must be able to add new pizzas to the menu whenever they come up with new creations so they need a simple form to make the process of adding data to the database straightforward. There are two forms which are required:
- A form to add new sizes of pizza
- A form to add new types of pizza
In the previous section you may have noticed something strange about the entity descriptions: they both have cost attributes.
, Name, Description, Cost)
This is for a very simple reason, each pizza has:
- A base cost that is dependent on its size (for example, a 12-inch pizza might cost £10)
- An additional cost depending on the type of pizza (for example, a Hawaiian might be £2 extra and a Meat Feast £4 extra).
The designs below so how the forms should look.
Create HTML forms that resemble as closely as possible the designs above. Use HTML5 form validation if necessary. A key question to consider is:
- How are you going to get the existing sizes and pizzas to display on your form?
- 1. Introduction to server-side scripting
- 2. Getting ready for server-side scripting
- 3. Preparing for your first script
- 4. Create your first server-side script
- 5. Capturing and processing data
- 6. Processing the form data
- 7. Server-side scripting and databases
- 8. Adding data to a database
- 9. Displaying data from the database
- 10. More on HTML forms
- 11. Pizza Kitchen
- 12. Administration Forms
- 13. Customer Account Form
- 14. Customer Order Form
- 15. Current Orders