“Bad hCaptcha nonce!” on arbitrary form
-
I’m working on a form of my own and I believe I have everything correctly configured. When filled in, the form validates and posts. I can see the field data server-side, including h-captcha-response. The wordpress plugin is installed, activated, correctly linked and validates (via the tool in settings).
But alas, the hcaptcha_verify_post() function refuses to return anything but “Bad hCaptcha nonce!“. Any clues as to what I might be missing are much appreciated.
The page posts to itself. This isn’t finished but here’s the server side code as it currently stands:
if( isset( $_POST ) && $_SERVER['REQUEST_METHOD'] === 'POST') { debug("we were POSTed to..."); $result = hcaptcha_verify_post(); if( null !== $result){ debug(esc_html($result)); debug("invalid captcha"); }else{ debug("captcha is valid"); } foreach ($_POST as $key => $value) { //Remove all slashes, php and html tags, and quote html entities. $_POST[$key] = htmlentities(strip_tags(removeslashes($value)), ENT_QUOTES, "UTF-8"); } debug(print_r($_POST,true)); }
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘“Bad hCaptcha nonce!” on arbitrary form’ is closed to new replies.