I am working on one Login system which is send a verification link to the user and user have to verify within the one hour.
So When user click on verification link. I get user id and the code form url.
So by using this First i Will check is it correct or not form database. This is the query.
$query = $this->db
->select('id,expiry_time')
->where('id', $id)
->where('code', $code)
->get('candidate');
$data = $query->row_array();
So I have to check if user has excluded the expiry_time limit or not so i use elseif.
if ($data === null) {
echo "Verification code not correct";
} elseif ($data['expiry_time'] < $expiry_time) {
echo "Your verification Time is expire ";
} else {
echo "Code is correct & Time is Not Expire yet";
}
So here i am facing a problem. I did not get the proper message.
I want Separate Message if code is not correct & if time is expire. I am little confused about it so if you suggest any correct way of getting proper error message than please tell me. Thanks.