'Sesame Seed Puff', 'square' => 'Coconut Milk Gelatin Square', 'cake' => 'Brown Sugar Cake', 'ricemeat' => 'Sweet Rice and Meat'); // Logic to do the right thing based on // the hidden _submit_check parameter if ($_POST['_submit_check']) { // If validate_form( ) returns errors, pass them to show_form( ) if ($form_errors = validate_form( )) { show_form($form_errors); } else { process_form( ); } } else { show_form( ); } // Do something when the form is submitted function process_form( ) { print "You ordered a ". $_POST['order']; } // Display the form function show_form($errors='') { if($errors) { print "