Welcome Guest, Not a member yet? Register   Sign In
Form Validation... Run always true
#2

[eluser]Mat-Moo[/eluser]
Code:
if($this->form_validation->run() == FALSE){
        
        $data = array(
                          'error' => "Welcome!",
                          'message' => "Thank you for taking the time to join BetterBiz.com.  Before you can begin using your account, you must first activate it by opening the email we sent you and visiting the link provided."
                          );
            $this->load->view('error_page', $data);
        
        } else {
        
            $this->load->model('member');
            if($this->member->create($_POST)){
                $data['displayName'] = $_POST['displayName'];
                $this->load->view('join_success');
            } else {
                $data = array(
                              'error' => "Database Error",
                              'message' => "A database error occurred while creating your account.  Please try again later."
                              );
                $this->load->view('error_page', $data);
            }
            
            
        }
Is your logic not backwards? Shouldn't it be "if($this->form_validation->run() == TRUE)" then show the thank you and tell them to check the activation email?


Messages In This Thread
Form Validation... Run always true - by El Forum - 10-06-2009, 01:30 PM
Form Validation... Run always true - by El Forum - 10-06-2009, 01:59 PM
Form Validation... Run always true - by El Forum - 10-06-2009, 02:03 PM
Form Validation... Run always true - by El Forum - 10-06-2009, 02:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB