[eluser]wakey[/eluser]
Hi,
I am attempting to use flashdata to send back form validation errors to a user when they submit a contact form. I have used this method in previous projects but cannot get it to work this time.
I am using the following code -
Code:
if ($this->form_validation->run() == FALSE)
{
$this->session->set_flashdata('contact','true');
$this->session->set_flashdata('valid', validation_errors());
$this->session->set_flashdata('name', $this->input->post('name', TRUE));
$this->session->set_flashdata('email', $this->input->post('email', TRUE));
$this->session->set_flashdata('message', $this->input->post('message', TRUE));
redirect('home/');
}
The only flashdata that I am able to echo after the redirect is 'contact'. If I change -
Code:
$this->session->set_flashdata('valid', validation_errors());
to
Code:
$this->session->set_flashdata('valid', 'error');
I can then echo the word 'error' after the redirect. Does anyone know how I can pass the validation and input data back to the 'home' using flashdata?
Thanks.