We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9122
    • 27 Posts
    I love eForm, I thinks it’s a great snippet. However, I’ve always hacked the code a bit so the Captcha verification is no longer case sensitive. I figured I’d share and see if anyone else found this valuable.

    The changes are as follows:
    eForm Snippet: Added one new parameter after line 42.
       'vericodecase' => isset($vericodecase)? $vericodecase:1,


    eform.inc.php: Added a case sensitivity check. Replaced lines 177 through 180.
    BEFORE:
    if($fields['vericode']!=$code) {
    	$vMsg[count($vMsg)]=$_lang['ef_failed_vericode'];
    	$rClass['vericode']=$invalidClass; //added in 1.4.4
    }
    

    AFTER:
    // check for captcha case sensitivity. Default is 1 for case sensitive.
    if($vericodecase == 1) {
    	$vcode = $fields['vericode'];
    	$realcode = $code;
    } else {
    	$vcode = strtoupper($fields['vericode']);
    	$realcode = strtoupper($code);
    } 
    
    if($vcode!=$realcode) {
    	$vMsg[count($vMsg)]=$_lang['ef_failed_vericode'];
    	$rClass['vericode']=$invalidClass; //added in 1.4.4
    	}



    Example Snippet Calls
    Snippet call for case sensitive Captcha verification code
    [!eForm? &formid=`feedbackForm` &vericode=`1` &vericodecase=`1`!]
    OR
    [!eForm? &formid=`feedbackForm` &vericode=`1` !]


    Snippet call for case insensitive Captcha verification code
    [!eForm? &formid=`feedbackForm` &vericode=`1` &vericodecase=`0`!]



    Hopefully someone will find this useful. I’ve attached the files containing the updates.
    - E String
      • 31381
      • 31 Posts
      was helpful - thanks!