codeigniter form validation if failed send user back
- by Momen M El Zalabany
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