[eluser]sasori[/eluser]
hi, is there something wrong with this code and why it renders the same view, in one page only ? ( actually, i got that code from the ion_auth library, i just modified it a bit )
Code:
/*
* forgot password function
*/
public function forgot_password()
{
$this->data['css'] = $this->css;
$this->data['jquery'] = $this->jquery;
$this->data['images'] = $this->images;
$this->data['base'] = $this->base;
$this->data['cufonyui'] = $this->cufonyui;
$this->data['cufonreplace'] = $this->cufonreplace;
$this->data['georgia'] = $this->georgia;
$this->data['title'] = 'Forgot Password';
$this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email');
if ($this->form_validation->run() == false)
{
//setup the input
$this->data['email'] = array('name' => 'email',
'id' => 'email',
);
//set any errors and display the form
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
$this->load->view('forgot_password', $this->data);
}
else
{
//run the forgotten password method to email an activation code to the user
$forgotten = $this->ion_auth->forgotten_password($this->input->post('email'));
if ($forgotten)
{ //if there were no errors
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect("site/login", 'refresh'); //we should display a confirmation page here instead of the login page
}
else
{
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect("forgot_password", 'refresh');
}
}
$this->load->view('forgot_password',$this->data);
}
here's the screen shot, , please have a look. T.I.A