Welcome Guest, Not a member yet? Register   Sign In
an enhanced captcha as helper
#14

[eluser]mr_coffee[/eluser]
I did this for the validation:

Code:
$this->session->set_userdata(array('security_code' => strtolower($data['captcha']['word'])));

Thereby storing the security code (in lower case) into a session variable for the user. Makes sense... since that code will be no good once the session expires. You'll want the above line to run on the page load.

Later on -- during form processing -- assuming the form also passes validation -- the user should have filled in a field (I used security_code for the name to keep it simple):

Code:
if (($this->validation->run() == FALSE) || ($this->session->userdata['security_code'] != strtolower($_POST['security_code']))) {
  this->_captchaerror();
} else {
  // code to send e-mail here.
}


Messages In This Thread
an enhanced captcha as helper - by El Forum - 09-27-2007, 07:39 AM
an enhanced captcha as helper - by El Forum - 09-27-2007, 01:01 PM
an enhanced captcha as helper - by El Forum - 09-30-2007, 03:13 PM
an enhanced captcha as helper - by El Forum - 10-27-2007, 10:06 AM
an enhanced captcha as helper - by El Forum - 10-27-2007, 10:29 AM
an enhanced captcha as helper - by El Forum - 10-27-2007, 08:26 PM
an enhanced captcha as helper - by El Forum - 10-29-2007, 04:27 AM
an enhanced captcha as helper - by El Forum - 10-29-2007, 04:40 AM
an enhanced captcha as helper - by El Forum - 05-08-2008, 02:21 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 02:21 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 02:54 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 05:36 AM
an enhanced captcha as helper - by El Forum - 06-04-2008, 09:52 AM
an enhanced captcha as helper - by El Forum - 09-25-2008, 10:01 PM
an enhanced captcha as helper - by El Forum - 01-11-2009, 08:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB