[eluser]X47X[/eluser]
This is the function register which calls to the view_register
function register(){
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username','trim|required|alphanumeric|min_length[6]|xss_clean|strtolower|callback_username_not_exists');
$this->form_validation->set_rules('name', 'Name','trim|required|alphanumeric|min_length[6]');
$this->form_validation->set_rules('email', 'Email Address','trim|required|min_length[6]|xss_clean|valid_email');
$this->form_validation->set_rules('password', 'Password','trim|required|alphanumeric|min_length[6]|xss_clean');
$this->form_validation->set_rules('password_conf', 'Password Confirmation','trim|required|alphanumeric|min_length[6]|matches[password]|xss_clean');
if($this->form_validation->run() == FALSE){
//hasn't been run or there are validation errors
$this->load->view('view_register', $this->view_data);
}else{
//no problems like validation errors and stuff
$name = $this->input->post('name');
$username = $this->input->post('username');
$password = $this->input->post('password');
$address = $this->input->post('address');
$email = $this->input->post('email');
$activation_code = $this->_random_string(10);
$this->User_model->register_user($name, $username, $password, $address, $email, $activation_code);
}
}
and i go to it trou' the
<a href="index.php/user" class="button"><span>Register</span>