diff options
author | Thedro Neely <thedroneely@gmail.com> | 2018-08-30 04:40:53 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2018-08-30 04:40:53 -0400 |
commit | 2659205908bd5cab508f4ff817123673e078ab74 (patch) | |
tree | e455f36b124e9b98f7005e6d4310b71881734623 /controllers | |
download | edwinmattiacci.com-2659205908bd5cab508f4ff817123673e078ab74.tar.gz edwinmattiacci.com-2659205908bd5cab508f4ff817123673e078ab74.tar.bz2 edwinmattiacci.com-2659205908bd5cab508f4ff817123673e078ab74.zip |
Initialize Repo: First Commit
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/comments.php | 3 | ||||
-rw-r--r-- | controllers/construction.php | 3 | ||||
-rw-r--r-- | controllers/contact.php | 3 | ||||
-rw-r--r-- | controllers/feedback.php | 3 | ||||
-rw-r--r-- | controllers/index.controller.php | 3 | ||||
-rw-r--r-- | controllers/mail.controller.php | 38 |
6 files changed, 53 insertions, 0 deletions
diff --git a/controllers/comments.php b/controllers/comments.php new file mode 100644 index 0000000..6f4abfa --- /dev/null +++ b/controllers/comments.php @@ -0,0 +1,3 @@ +<?php + +require '../bootstrap/comments/comments.php'; diff --git a/controllers/construction.php b/controllers/construction.php new file mode 100644 index 0000000..d0a8604 --- /dev/null +++ b/controllers/construction.php @@ -0,0 +1,3 @@ +<?php + +require '../views/construction.view.php'; diff --git a/controllers/contact.php b/controllers/contact.php new file mode 100644 index 0000000..6ecc88e --- /dev/null +++ b/controllers/contact.php @@ -0,0 +1,3 @@ +<?php + +require '../views/contact.view.php'; diff --git a/controllers/feedback.php b/controllers/feedback.php new file mode 100644 index 0000000..8f96420 --- /dev/null +++ b/controllers/feedback.php @@ -0,0 +1,3 @@ +<?php + +require '../views/feedback.view.php'; diff --git a/controllers/index.controller.php b/controllers/index.controller.php new file mode 100644 index 0000000..a4fa714 --- /dev/null +++ b/controllers/index.controller.php @@ -0,0 +1,3 @@ +<?php + +require '../views/index.view.php'; diff --git a/controllers/mail.controller.php b/controllers/mail.controller.php new file mode 100644 index 0000000..f850ed7 --- /dev/null +++ b/controllers/mail.controller.php @@ -0,0 +1,38 @@ +<?php + +$submit = new Form(); + +$submit->name = $_POST['26471']; +$submit->email = $_POST['26472']; +$submit->message = $_POST['26478']; + +$spam = false; + +if (isset($_POST['contact'])) { + $spam = $_POST['contact']; +} + +if ((bool) $spam == true) { + http_response_code(403); + error_log('Contact Form Spam: Error 403'); + return; +} + +if ((bool) empty($submit->name) == true + || (bool) empty($submit->email) == true + || (bool) empty($submit->message) == true +) { + header('Location: /contact'); + return; +} else { + include '../views/sent.view.php'; + fastcgi_finish_request(); + $contact['database']->insert( + 'contactform', [ + 'name' => $submit->name, + 'email' => $submit->email, + 'message' => $submit->message, + ] + ); + sendMail($submit->name, $submit->email, $submit->message); +} |