How to set Flashdata in Codeigniter

This page all about how to set flashdata in Codeigniter. Codeigniter has a very good
feature like one time show message in view page. One time means very next server request is carry the message, then automatically it unset after one time page refresh. This is feature is called as flashdata. Before redirect page from controller we have to set that message , which we have to show in view page.

Now We can set this in our controller.. like below example.

 



Now How to show in view page

NB:
If there are multiple redirect the flashdata may loss. So to keep safe for next additional request, we have to use

 

Advertisements