Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
<?php
...
if(!$_POST['time'])
{
$error['time'] = TRUE;
}
...
if(isarray($error))
{
...
}
...
?>
$required = array('name','email','message');
$errors = array();
foreach($_POST as $k=>$v){
if(in_array($k,$required) and $v==''){
$errors[] = 'Please fill in your '.$k.'.';
}
}
if($error_count = count($errors)){
$msg = '<ul><li>Please fill in the the following field'.($error_count>1?'s':'').' before proceeding:</li>';
for($i=0; $i<$error_count; $i++){
$msg .= '<li>'.$errors[$i].'</li>';
}
$msg .= '</ul>';
echo $msg;
exit;
} else {
// do email thing
}
1 to 6 of 6