Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (empty($_POST) || !SmartyValidate::is_registered_form('ContactForm'))
- {
- SmartyValidate::connect($smarty, true);
- SmartyValidate::register_form('ContactForm', true);
- SmartyValidate::register_validator('checkContactName', 'contactName', 'notEmpty', false, false, 'trim', 'ContactForm');
- SmartyValidate::register_validator('checkContactComment', 'contactComment', 'notEmpty', false, false, 'trim', 'ContactForm');
- SmartyValidate::register_validator('checkContactEmail', 'contactEmail', 'isEmail', false, false, 'trim', 'ContactForm');
- }
- else
- {
- SmartyValidate::connect($smarty);
- if(SmartyValidate::is_valid($_POST,'ContactForm'))
- {
- SmartyValidate::disconnect();
- }
- else
- {
- $smarty->assign($_POST);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement