Welcome Guest, Not a member yet? Register   Sign In
integrate form validation and captcha helper
#6

[eluser]B3geN14S[/eluser]
[quote author="treenef" date="1403702768"]What I do is generate a random four digit number using the random library.

Then in the controller I set this in a session. When the form is submitted I check the session matches the input text.

Code:
$random = "2839";  <- store this in a session

$vals = array(
      'word'  => $random,
      'img_path'  => path-to-captcha/',
      'img_url'  => base_url().'path-to-captcha/',
      'font_path'  => 'path-to-font.ttf',
      'img_width'  => '150',
      'img_height' => 30,
      'expiration' => 300
  );
[/quote]

Thanks for the option you proposed, treenef!
Since this is my first project with CodeIgniter, could you provide some sample code to make it clearer to me?


Messages In This Thread
integrate form validation and captcha helper - by El Forum - 01-18-2012, 07:00 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 04:59 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 06:26 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 08:29 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 11:52 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 11:55 AM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 03:39 PM
integrate form validation and captcha helper - by El Forum - 06-25-2014, 11:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB