I use codeigniter, i want make valid data for captcha, if captcha is mixed of lower and uppercase characters, user should insert in input like it lower or uppercase or mixed they.
in following code i tried it, but it don’t check lower and uppercase characters, how can fix it?
my captcha image is as: dAwVJ
//$cap = $this->input->post('captcha');
$cap = 'dAwVJ';// if i change this to dawvj return(output) is true, i don't want this
// Then see if a captcha exists:
$sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?";
$binds = array(
$cap,
$this->input->ip_address(),
$expiration
);
$query = $this->db->query($sql, $binds);
$row = $query->row();
if ($row->count == 0) {
return false;
} else {
return true;
}
1 Answer