CodeIgniter Forums
Flash Data a Day Late - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Flash Data a Day Late (/showthread.php?tid=36364)



Flash Data a Day Late - El Forum - 11-29-2010

[eluser]Leovenous[/eluser]
My continuing series of noobie questions:

My form, the same one I was dealing with before, isn't displaying flash data until after I refresh the page manually.

www.hourlysteals.net

Put in fake info. Then after you submit it, hit submit again. THEN the flash message shows up.

Controller excerpt:
Code:
$this->session->set_flashdata('notice', 'Your request was processed. Thanks for joining the movement!');
$this->index();

Line of out the View:
Code:
<p>&lt;?php echo $this->session->flashdata('notice'); ?&gt;</p>

My guess is that there is nothing to trigger a new "page" so to speak, by slipping back into index. I also notice that the 2nd and 3rd segment remain in the URI, which confuses me.

Also, I'd like to just not have those para tags unless there is a flash message. Is there an 'isset' or something like that, to determine if there is a flash message?


Flash Data a Day Late - El Forum - 11-29-2010

[eluser]Leovenous[/eluser]
I figured it out. I needed a redirect. That fired everything properly. See, I'm getting this, slowly.