"; foreach($errors as $error) { print "
  • $error
  • "; } print ""; } print<<<_HTML_
    Your Order:
    _HTML_; } // Check the form data function validate_form( ) { // Start with an empty array of error messages $errors = array( ); if (! in_array($_POST['order'], $GLOBALS['sweets'])) { $errors[ ] = 'Please choose a valid order.'; } return $errors; } ?>