Redirect after insert or update
- Single Page
Posted 18 April 2012 - 11:18 AM
I know, some people asked this before, but I don't fins the solution. I have different groceryCRUDs in my applications. In one of them, instead of to redirect to the list I want to redirect somewhere else. For example...
[php]
$crud->callback_insert(array($this,'my_insert'));
function my_insert($post_array)
{
/* do whatever with the $post_array */
/* redirect to another controller */
}
[/php]
I was trying with...
[php]
header('Location: '.base_url().'controller');
echo '<script type="text/javascript">window.location.href = "'.base_url().'controller";</script>';
redirect('controller');
[/php]
Any of them is working. Allways it comes back to the list. Any idea, please? Thanks.
Posted 18 April 2012 - 12:06 PM
Posted 20 June 2016 - 13:10 PM
Hmm, you wanna redirect user on another controller/action by using $crud->callback_after_insert or something else..
Please, check this post might be its useful for you : link