diff --git a/guestbook.php b/guestbook.php index 5cb77c7..bdc4769 100644 --- a/guestbook.php +++ b/guestbook.php @@ -33,7 +33,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $trap = trim($_POST['url'] ?? ''); $ok = false; - if ($trap !== '') { + // bots POST name/msg straight to this endpoint, skipping the htmx form and + // its honeypot. Real signs come via hx-post (HX-Request header); treat any + // non-htmx POST like a honeypot hit — fake success, insert nothing. + if ($trap !== '' || !$isHtmx) { $ok = true; } elseif ($name === '' || $msg === '') { $notice = 'name and message are required.';