aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2018-12-27 17:18:30 -0500
committerThedro Neely <thedroneely@gmail.com>2018-12-27 17:18:30 -0500
commit6152b7394a1ff2211a79dc3521593f3b7deabb6b (patch)
tree60f2b4c0d41f8aa616c3380f63366ce30c70e6b6 /app/controllers
parent0c862307dd20a7ecb7a72e3f262fe9ac38455ca0 (diff)
downloadthedroneely.com-6152b7394a1ff2211a79dc3521593f3b7deabb6b.tar.gz
thedroneely.com-6152b7394a1ff2211a79dc3521593f3b7deabb6b.tar.bz2
thedroneely.com-6152b7394a1ff2211a79dc3521593f3b7deabb6b.zip
app/controllers/mail: Let mail controller commit to database
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/mail.controller.php18
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,
+ ]
+);