Welcome Guest, Not a member yet? Register   Sign In
Help form validation
#1

[eluser]Unknown[/eluser]
Quote: public function index(){
$this->load->library("form_validation");
$this->form_validation->set_rules("login", "Login", "callback_check");

if($this->form_validation->run() == FALSE)
{
$this->load->view("login/login_view");
}
else
{
//I want access to $data['info'] that return from check() function

}
}
public function check(){
$data['info'] = array(
"username" => $this->input->post("username"),
"password" => $this->input->post("password"),
);
$data['info'] = $this->User_model->checklogin($data['info']);
if($data['info'] == FALSE)
{
$this->form_validation->set_message("check", "Wrong username or password. %s fail.");
return FALSE;
}
else
{
return $data['info']; //$data['info'] is array
}
}

In index() function, How can i access to $data['info'] that return from check() function.

Please help me. Thanks all!


Messages In This Thread
Help form validation - by El Forum - 03-04-2011, 11:29 PM
Help form validation - by El Forum - 03-04-2011, 11:37 PM
Help form validation - by El Forum - 03-05-2011, 12:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB