diff --git a/src/_includes/partials/components/contact-form.njk b/src/_includes/partials/components/contact-form.njk index 2cfb240..bfe55c2 100644 --- a/src/_includes/partials/components/contact-form.njk +++ b/src/_includes/partials/components/contact-form.njk @@ -7,12 +7,12 @@
diff --git a/src/form/contact-form-handler.php b/src/form/contact-form-handler.php index 18ec6af..4c1cb29 100644 --- a/src/form/contact-form-handler.php +++ b/src/form/contact-form-handler.php @@ -2,12 +2,16 @@ $errors = ''; $myEmail = 'contact-form@astrolabe.coop'; // email address to send form content - if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) { + if(empty($_POST['namezzz']) || empty($_POST['emailzzz']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } - $name = $_POST['name']; - $emailAddress = $_POST['email']; + if(!empty($_POST['name']) && !empty($_POST['email'])) { + $errors .= "\n Error: spam"; +} + + $name = $_POST['namezzz']; + $emailAddress = $_POST['emailzzz']; $select = $_POST['select']; $message = $_POST['message']; $subscribe = $_POST['subscribe']; diff --git a/src/scss/components/_form.scss b/src/scss/components/_form.scss index c2db8a8..496c62c 100644 --- a/src/scss/components/_form.scss +++ b/src/scss/components/_form.scss @@ -127,6 +127,16 @@ legend { } } +.ohnohoney { + opacity: 0; + position: absolute; + top: 0; + left: 0; + height: 0; + width: 0; + z-index: -1; +} + @media (max-width: 575.98px) { .form-container { svg {