i have this controller(visits.php) that use 3 models to build page, then it pass 4 vars to a view.
this view contain a form that submit to another page (add_user.php)
my question is how can i send the user back to visits.php in case the for_validation is false ?
do i have to reload visits.php allover again ?-waste of resourss- or i should just send him back in history with js or php header for example ? can u plz show me an example of how u best handle false result of form_validation ?
Note that when i user
header('Location: ' . $_SERVER['HTTP_REFERER']);
i couldnt echo validation_error() 🙁
thanks for help
You can store validation_error() in a piece of flash data, then you can use header(Location) – or you could use the codeigniter redirect() function and fetch the flashdata in the redirected page.