[eluser]Alpha[/eluser]
<?php
class Form extends CI_Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}
}
?>
at the view myform.php the errors will be displayed using <?php echo validation_errors(); ?> but what my setup is that from the above Form controller i need to pass the form_validation object/results to the 2nd controller and i need the 2nd controller to know what happened/results from the previous controller through the passed object so that it can also print <?php echo validation_errors(); ?> when needed or for whatever purpose. tnx!