CodeIgniter Forums

Full Version: Captcha. 2 captchas???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ThijssjihT[/eluser]
Every time a page with a captcha is visited, 2 captchas are created. I get 2 images in the folder, and 2 database rows. I use the standard captcha helper.
It's not a very big problem, becouse everything works, but it isn't very nice.

controller:
Code:
$attr = array('img_path' => './inc/captcha/', 'img_url' => base_url() . 'inc/captcha/');
$cap = create_captcha($attr);
$attr = array('captcha_time' => $cap['time'], 'ip_address' => $this->input->ip_address(), 'word' => $cap['word']);
$query = $this->db->insert_string('captcha', $attr);
$this->db->query($query);
$data['captcha'] = $cap['image'];

the $data variable is send to the view

I can't see what's wrong here.