Hi,

I have installed captcha & textimage modules.
On going to registration page or node page, I am Getting "The image verification code you entered is incorrect." message even if i am going to that page first time.

I tried the below mentioned solution:

replace:

    if (!_captcha_validate($_POST['edit']['captcha_response'])) {
      //use call_func because module_invoke does not allow call by reference.
      if (module_hook($captcha_type, 'captchachallenge')) {
        call_user_func_array($captcha_type.'_captchachallenge', array(&$form, &$_SESSION['captcha']));  
      }
    }

with:

    if (isset($_POST['captcha_response'])) {
      _captcha_validate($_POST['captcha_response']);
    }
    if (module_hook($captcha_type, 'captchachallenge')) {
      call_user_func_array($captcha_type .'_captchachallenge', array(&$form, &$_SESSION['captcha']));
    }

Now i am not getting error message first time but getting it again on entering the code & clicking submit.
Basically, it is not passing the code check.

I have posted as an issue to module owner, but no response.

Please help me out.

Thanks in advance.

Regards,
Sumoanand

Comments

AjK’s picture

Moving post to the "Post Installation" forum. Best to get your question in front of eyes that provide support.

pobster’s picture

I have no idea whether this is correct but common sense tells me you'd be better doing it this way;

    if (isset($_POST['captcha_response'])) {
      if (!_captcha_validate($_POST['captcha_response'])) {
        if (module_hook($captcha_type, 'captchachallenge')) {
          call_user_func_array($captcha_type .'_captchachallenge', array(&$form, &$_SESSION['captcha']));
        }
      }
    }

Reason being is that the original code has the second if statement executed after _validate is FALSE. In the 'fix' you posted, they're two completely separate parts, neither rely on each other - they're both being called.

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

sumoanand’s picture

Thanks Paul,

I will try & let you know.

Actually the above fix was suggested here

& has solved the problem for many guys except me :(

Thanks,
Sumoanand

sumoanand’s picture

Problem is still there.. :(

sumoanand’s picture

thanks Andy