Little help with captcha

Discussion in 'PHP' started by testu, May 9, 2011.

  1. #1
    Hi,

    I am using CodeIgniter on my website and I have a form which allows users to sign up on my website. They must enter a captcha code when signing up. The problem is that something went wrong and even if the captcha code is entered correctly users get "Captcha Code invalid". Can someone tell me if there's anything wrong with these lines?


                                    $string = trim(strtoupper(base64_decode(get_cookie('string'))));
    
                                    $detalii['captcha'] = trim(strtoupper($this->input->post('captcha')));
                                    $cuc = $this->input->post('phonenumber');
                                    if($string!=$detalii['captcha']) $data['mesaj'] = "Captcha code invalid.";
    
    Code (markup):
    Thanks!
     
    testu, May 9, 2011 IP
  2. bogi

    bogi Well-Known Member

    Messages:
    482
    Likes Received:
    16
    Best Answers:
    2
    Trophy Points:
    140
    #2
    Have you checked the content/value of the $string and $detalii['captcha'] variables? Was the cookie 'string' set?
     
    bogi, May 9, 2011 IP