tag print ''; } function display_form($defaults) { global $subject_options; ?>
Subject
Your email
Your phone number
Comments
Thank you for your submission. Your comments are genuinely appreciated.

"; } // end function definitions /////////////////////////// // begin form-handling logic /////////////////////////// $subject_options = array( ''=>'[select one]', 'rant'=>'rant', 'praise'=>'praise', 'question'=>'question'); if ($_POST) { $errors = validate_form($_POST); if ($errors) { echo "

Sorry, we are unable to process your submission because:

", "

Please correct your form below and re-submit it

"; display_form($_POST); } else { process($_POST); } } else { $defaults = array('subject'=>'','comments'=>'','phone'=>'','email'=>''); display_form($defaults); }