Beispiel #1
0
 private static function validateForm()
 {
     $result = array('validated' => false, 'invalid' => array());
     Form::validate($_POST);
     if (!Form::isValid()) {
         $result['invalid'] = Form::getInvalidFields();
     } else {
         $result['validated'] = true;
         $result['fieldValues'] = Form::getValues();
         unset($result['fieldValues']['dataTable']);
         // remove sensitive data
         self::sendmail();
     }
     //header('Content-Type: application/json'); // IE 8 treats it as a download
     header('Content-Type: text/html');
     echo json_encode($result);
 }