CodeIgniter Forums
Captcha not working on Mac OS x - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Captcha not working on Mac OS x (/showthread.php?tid=48794)



Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]Gukkie[/eluser]
Hi, i am having a problem with a registration page.

It seems this problem only happens for MAC OS X users using any browser.

After filling up a registration page and clicking on submit, the captcha field always throws an "Invalid Captcha" error which means the captcha validation is not going through or failing.

Why is this happening?

This works fine for all users not using mac os x.

Is there a way to fix this problem?

My Validation code:
Code:
function validate_captcha_model()
{
  //checking input
  $expiration = time()-3600;
  $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?";
  $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);
  $query = $this->db->query($sql, $binds);
  $row = $query->row();

  if($row->count > 0)
   {
      return true;
   }
   return false;
}

Cheers!


Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]vbsaltydog[/eluser]
Enable the profiler.


Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]Gukkie[/eluser]
Alright i have got it working, it seems that only one mac os x was giving the problem, havent figured out wats causing it Smile


Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]vbsaltydog[/eluser]
The client OS/browser has NOTHING to do with the server side logic so the only thing you need to check is the post data received by the server.


Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]Gukkie[/eluser]
It works on a different mac os x, im guessing something isn't working right on the one thats throwing the error.

thanks buddy Smile


Captcha not working on Mac OS x - El Forum - 01-29-2012

[eluser]vbsaltydog[/eluser]
Glad to help.