[eluser]dejitaru[/eluser]
I think It may be a problem of syntaxis because the combination of php4 and php5. If u are using php4, change the name of the method registrarse for-> Registrarse with uppercase R and create a separate method for what u are doing:
class Registrarse extends Controller
{
function Registrarse()
{
parent::Controller() ;
$this->load->helper('form');
}
function registro(){
// Required Field Rules.
$rules['username'] = "required";
$rules['password'] = "required";
$rules['password2'] = "required";
$rules['email'] = "required";
$rules['question'] = "required";
$rules['answer'] = "required";
$this->load->library('validation');
$this->validation->set_rules($rules);
// Required Field Names
$fields['username'] = "Username";
$fields['password'] = "Password";
$fields['password2'] = "Repeat Password";
$fields['email'] = "Email Address";
$fields['question'] = "Secret Question";
$fields['answer'] = "Secret Answer";
$this->validation->set_fields($fields);
if ($this->validation->run())
{
// Validation Passed
$redux = $this->redux_auth->register
(
$this->input->post('username'),
$this->input->post('password'),
$this->input->post('email'),
$this->input->post('question'),
$this->input->post('answer')
);
// The reason we put the method into a variable is so we can deal
// with the different return messages.
// I use a switch statement to deal with the different return
// messages produced by the registration method.
switch ($redux) {
case 'REGISTRATION_SUCCESS':
# code...
break;
case 'REGISTRATION_SUCCESS_EMAIL':
# code...
break;
case false:
# code...
break;
case true:
# code...
break;
} //end of switch
}
else
{
$this->load->view("usuarios/registrarse");
}
}
}