<html>
<!-- -----------------------------------------------------------------------------------
// This html form uses certain keywords that the php script uses to
// validate the fields, repopulate the fields, and flag errors.
//
// The idea is to separate the html code completely from the php code
//
// This html code will need to use:
// %SELF% to substitute the php script name
// %fieldname% to substitute the value of the field
// %fieldname.error% to flag the field if in error
// %fieldname.fieldvalue.checked% to flag radio or checkbox to be checked
// %fieldname.fieldvalue.selected% to flag select list to be selected
// %MESSAGE% to substitute where the error message go
//----------------------------------------------------------------------------------- -->
<head>
<title>Order Ice Cream</title>
</head>
<body bgcolor=lightyellow>
<h1><center>The Ice Cream Shop</center></h1>
<h2>Separate the HTML from the PHP code</h2>
<form method=POST action='%SELF%' > <!-- itself -->
<fieldset style='width:570px; height:310px; border-color:gold'>
<legend>Enter Fields Below</legend>
<table bgcolor=eeeeee>
<tr>
<td><b>First Name <font color=red> %firstname.error% </font>
<td><input type=text name=firstname value='%firstname%' >
<tr>
<td><b>Last Name <font color=red> %lastname.error% </font>
<td><input type=text name=lastname value='%lastname%' >
<tr>
<td><b>Enter Address <font color=red> %address.error% </font>
<td><textarea name=address rows=4 cols=47>%address%</textarea>
<tr>
<td><b>Ice Cream Flavor <font color=red> %flavor.error% </font>
<td><select name='flavor[]' SIZE='4' multiple='multiple'>
<option value='vanilla' %flavor.vanilla.selected% >Vanilla</option>
<option value='chocolate' %flavor.chocolate.selected% >Chocolate</option>
<option value='strawberry' %flavor.strawberry.selected% >Strawberry</option>
<option value='butter-pecan' %flavor.butter-pecan.selected% >Butter Pecan</option>
<option value='rocky-road' %flavor.rocky-road.selected% >Rocky Road</option>
<option value='french-vanilla' %flavor.french-vanilla.selected% >French Vanilla</option>
<option value='pistachio' %flavor.pistachio.selected% >Pistachio</option>
</select>
<tr>
<td><b>Select Topping <font color=red> %topping.error% </font>
<td>
<input type='checkbox' name='topping[]' value='hotFudge' %topping.hotFudge.checked% /> Hot Fudge
<input type='checkbox' name='topping[]' value='sprinkles' %topping.sprinkles.checked% /> Sprinkles
<input type='checkbox' name='topping[]' value='nuts' %topping.nuts.checked% /> Nuts
<input type='checkbox' name='topping[]' value='whippedCream' %topping.whippedCream.checked% /> Whipped Cream
<tr>
<td><b>Choose Credit Card <font color=red> %creditCard.error% </font>
<td>
<input type=radio name=creditCard value='visa' %creditCard.visa.checked% /> Visa
<input type=radio name=creditCard value='mc' %creditCard.mc.checked% /> Master Card
<input type=radio name=creditCard value='amex' %creditCard.amex.checked% /> Amex
<tr>
<td width=155>
<input type=submit value=' Place Order '>
<td><input type=reset value='Cancel'>
</table>
</fieldset>
<br><font color=red> %MESSAGE% </font>
<br/>
</form>
</body>
</html>