Welcome Guest, Not a member yet? Register   Sign In
Captcha custom words function
#1

[eluser]tinawina[/eluser]
Hi there - we wanted to use our own word list with CI's captcha helper. The user guide mentions that we can do this, but not how. It's actually really simple - here's a little code snippet we just wrote for this purpose. Hope it helps out someone else!

Code:
function captcha_random_word()
{
$words = array(
  'red',
  'blue',
  'Green',
  'purPle',
  'right on'
  /*keep adding words - the more the better...*/
);

$random_keys = array_rand($words, 1);
return $words[$random_keys];
}




Theme © iAndrew 2016 - Forum software by © MyBB