• Resolved bml13

    (@bml13)


    When using your captcha in registration form, you show error messages in separate page and use browser back button, but this is not good. You should use WordPress filters and actions to show your errors the same way WordPress does. It shows the errors above the registration form after submit.

    https://www.ads-software.com/plugins/humancaptcha/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bml13

    (@bml13)

    I have fixed that by replacing you line:

    add_filter('register_post', array(&$this, 'obr_register_validate_answer'), 10, 2);

    by this line

    add_filter(‘registration_errors’, array(&$this,’my_validate_answer’), 10, 3);

    and added this function:

    function my_validate_answer($errors, $sanitized_user_login, $user_email) {
    
                    if (!session_id()){
                            session_start();
                    }
                    if ((!isset($_POST['answer'])) || ($_POST['answer'] == '')){
                            $errors->add('obr_error',__('Error: please fill the required field (humancaptcha).', 'humancaptcha'));
                    }
                    $user_answer = md5(strtolower(trim($_POST['answer'])));
                    $obr_answer = strtolower(trim($_SESSION['obr_answer']));
                    if ($user_answer != $obr_answer){
                            $errors->add('obr_error',__('Error: your answer to the humancaptcha question is incorrect.', 'humancaptcha'));
                    }
    Plugin Author Outerbridge

    (@outerbridge)

    Thank you bml13 – looks like this might be a very useful suggestion. We will take a look at this.

    Plugin Author Outerbridge

    (@outerbridge)

    Thanks again. We’ve incorporated this into version 1.7.

    Thread Starter bml13

    (@bml13)

    That is great. Many thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error messages should not be in separate page’ is closed to new replies.