[eluser]mi6crazyheart[/eluser]
U'r MODEL function is really confusing. U r trying to do a lot of things in one single MODEL function with having multiple numbers "return" statements.
Any way, about u'r main prob of captcha validation is returning always TRUE , for that i want to say.. plz clearly write the captcha making code at one place...
EX: Here is the captcha making code which u can directly use in VIEW file...
Code:
$vals = array(
'word' => '',
'img_path' => './captcha/',
'img_url' => base_url().'captcha/',
'font_path' => './path/to/fonts/texb.ttf',
'img_width' => '150',
'img_height' => 30,
'expiration' => 7200
);
$cap = create_captcha($vals);
$data = array(
'captcha_time' => $cap['time'],
'ip_address' => $this->input->ip_address(),
'word' => $cap['word']
);
$query = $this->db->insert_string('captcha', $data);
$this->db->query($query);
echo $cap['image'];
Try it...