How to handle redirections with codeigniter?

Posted by SinneR on Stack Overflow See other posts from Stack Overflow or by SinneR
Published on 2010-03-19T20:39:09Z Indexed on 2010/03/19 20:41 UTC
Read the original article Hit count: 124

Filed under:
|
|
|

Hi, im having problems starting a codeigniter project, the problem is that when i do something in a controller and then i want a page to display the result, an example: i have a form to add a item to the database, i get all the data in the controller and save it to database and then i want (if all went well) to redirect to the main page with a success msg, i was doing this with

$this->load->view('admin', $data);

the problem is that the url keeps saying admin/addItem so everytime the page gets refreshed it adds another item, now i found the:

redirect('admin','refresh');

but this only helps me when i dont need to display any msg because this function dont allow to send a $data var. Any ideas? Probably this is really easy to fix but i cant find a way to handle the flow of the application the way i want, any help is apreciated. thanks ;)

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter