diff options
author | 53hornet <atc@53hor.net> | 2021-11-23 16:56:50 -0500 |
---|---|---|
committer | 53hornet <atc@53hor.net> | 2021-11-23 16:56:50 -0500 |
commit | 67d2e7e1f3bdc0fc3a6ae6bc8982bb1aa09e074d (patch) | |
tree | 684e4d23b04a4f7ba42692e6dfa59dc1597eaedd | |
parent | 3303c13b7610ed45cbdddac7ab406b15888690f4 (diff) | |
download | carpentertutoring-67d2e7e1f3bdc0fc3a6ae6bc8982bb1aa09e074d.tar.xz carpentertutoring-67d2e7e1f3bdc0fc3a6ae6bc8982bb1aa09e074d.zip |
fix: ignore forms with honeypot filled out
-rw-r--r-- | index.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -358,7 +358,6 @@ <section id="contact"> <form class="card" action="/#contact" method="post"> <h2>Contact</h2> - <input class="honeypot" name="emailAddress" type="text" /> <label for="name">Name</label> <input name="name" type="text" id="name" placeholder="Jane Doe" required /> @@ -366,6 +365,8 @@ <label for="email">Email Address</label> <input name="email" type="email" id="email" placeholder="jdoe85@aol.com" required /> + <input class="honeypot" name="content" type="text" /> + <label for="body">Question/Comment</label> <textarea name="body" id="body" placeholder="Briefly describe your inquiry, including any services or areas of study you're interested in." required></textarea> @@ -380,7 +381,7 @@ require('PHPMailer-master/src/Exception.php'); // handle form submission - if (isset($_POST['name'], $_POST['email'], $_POST['body'])) { + if (empty($_POST['content']) && isset($_POST['name'], $_POST['email'], $_POST['body'])) { $body = substr(strip_tags($_POST['body']), 0, 16384); $name = substr(strip_tags($_POST['name']), 0, 255); |