assign("title", "Contact | Desmond Fine Art Appraisal and Consulting"); $smarty->assign("bodyid", "contact"); if(empty($_POST)) { SmartyValidate::connect($smarty, true); SmartyValidate::register_validator('v_name','name','notEmpty'); SmartyValidate::register_validator('v_email','email','isEmail'); SmartyValidate::register_validator('v_note','note','notEmpty'); $smarty->display('jodesmond_contact.tpl'); } else { SmartyValidate::connect($smarty); // validate after a POST if(SmartyValidate::is_valid($_POST)) { // no errors, done with SmartyValidate include 'process_contact.php'; SmartyValidate::disconnect(); $smarty->display('jodesmond_message_sent.tpl'); } else { // error, redraw the form $smarty->assign($_POST); $smarty->display('jodesmond_contact.tpl'); } } ?>