Welcome Guest, Not a member yet? Register   Sign In
ensure user is 18 years of age - date valdation.
#3

[eluser]Andy78[/eluser]
I added the return true but its not making any difference. The problem lies in how im feeding valid_date() with the day, month and year variables but i dont no how to do it correctly

Code:
function valid_date()
    {
          $day     = (int)$this->input->post('day');
          $month    = (int)$this->input->post('month');
          $year    = (int)$this->input->post('year');
          
          
          $birthday = mktime(0, 0, 0, $month, $day, $year);
          
        
        if (!checkdate($birthday))
        {
            $this->validation->set_message('valid_date', 'The %s field is invalid.');
            return FALSE;
         }
        
        if ($birthday > strtotime('-18 years')) {
                $this->validation->set_message('valid_date', 'You must be 18 years old to sign up.');
                return false;
          }
            
            
          return TRUE;
    }


Messages In This Thread
ensure user is 18 years of age - date valdation. - by El Forum - 11-01-2010, 09:44 PM
ensure user is 18 years of age - date valdation. - by El Forum - 11-02-2010, 11:00 AM
ensure user is 18 years of age - date valdation. - by El Forum - 11-02-2010, 10:04 PM
ensure user is 18 years of age - date valdation. - by El Forum - 11-03-2010, 07:25 AM
ensure user is 18 years of age - date valdation. - by El Forum - 11-03-2010, 10:43 AM
ensure user is 18 years of age - date valdation. - by El Forum - 11-03-2010, 12:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB