• I’ve added “V2 I’m not a robot” Captcha verification to a custom form (ajax simple chat) by adding the code <?php do_action(‘anr_captcha_form_field’);?> before the “submit” function of the chatbox.

    The Captcha displays and can be used, but it is not required to be completed in order to post into the chatbox and therefore spam is still being submitted.

    Any help would be appreciate. I can provide more code or info as needed.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • You will need to verify captcha in server side.
    Eg. your chatbox send a message. before sending message you will need to use anr_verify_captcha() function to verify captcha. If it return true then you can continue, otherwise show error that captcha is not verified.

    Thread Starter wilbobaggins

    (@wilbobaggins)

    Thanks, Shamim. I’m not exactly sure where to place this code in the custom form php. I’ve tried it in a few places, but it doesn’t seem to be take effect. As you can see in the code below, I’ve placed the captcha form before the submit button. But where should the “verify captcha” code be placed?

    Thanks for the help. I can provide any additional code as a needed.

    <?php do_action(‘anr_captcha_form_field’);?>

    <div id=”sac-user-submit”>
    <div class=”sac_js_nonce”></div>
    <input type=”submit” id=”submitchat” name=”submit” class=”submit” value=”<?php esc_attr_e(‘Submit’, ‘simple-ajax-chat’); ?>” />
    <input type=”hidden” id=”sac_lastID” value=”<?php echo $lastID + 1; ?>” name=”sac_lastID” />
    <input type=”hidden” name=”sac_no_js” value=”true” />
    <input type=”hidden” name=”PHPSESSID” value=”<?php echo session_id(); ?>” />
    <?php wp_nonce_field(‘sac_nonce’, ‘sac_nonce’, false); ?>
    </div>

    You will need to verify captcha server side not client side. This form submit message to your server, there must have some code which process this message and add to db. You will need to check captcha there.

    Thread Starter wilbobaggins

    (@wilbobaggins)

    Thanks, Shamim. I think I’ve found the .php file that processes the chat, but I can’t figure out how to correctly modify the code with the verify command to make it work. Whatever I do either disables the posting of the message completely or allows for posting without verifying the captcha.

    I’ve contacted the chat plug-in author but haven’t heard back yet. If you’d be interested in helping me more directly with editing the source code, please reach out to me to talk about how I might procure your services.

    Thank you.

    You can contact me directly in https://www.shamimsplugins.com/contact-us/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Captcha Not Enforced In Custom Form’ is closed to new replies.