diff options
-rw-r--r-- | app/controllers/mail.controller.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/mail.controller.php b/app/controllers/mail.controller.php index b71934b..93260c8 100644 --- a/app/controllers/mail.controller.php +++ b/app/controllers/mail.controller.php @@ -9,23 +9,23 @@ $form = new Form( $message = $_POST['26478'] ); -// $contact['database']->insert( -// 'contactform', [ -// 'name' => $form->name, -// 'email' => $form->email, -// 'message' => $form->message, -// ] -// ); - $validEmail = PHPMailer::validateAddress($email, 'auto'); if ($validEmail === false ) { $mailError = 'Invalid email' . "\r" . '<em>'. $email . '</em>'; include '../app/views/mail-error.view.php'; + return; } require '../app/views/mail-sent.view.php'; fastcgi_finish_request(); - $form->isSubmit(); + +$contact['database']->insert( + 'contactform', [ + 'name' => $form->name, + 'email' => $form->email, + 'message' => $form->message, + ] +); |