Some help with flashdata and form_validation - 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: Some help with flashdata and form_validation (/showthread.php?tid=16791) |
Some help with flashdata and form_validation - El Forum - 03-16-2009 [eluser]Unknown[/eluser] Hello all, I am a little stuck with this one. I need a form in the footer of all of my pages. I have a shell template view that calls the form view inside of it. Since I obviously don't want to rewrite all of my validation code for every page, I have created a separate controller to handle the form. I then assumed I could set the form validation errors in the flashdata session, redirect to the previous page, and display any errors above the form.. I guess my question is.. am I setting this up wrong? Here is my controller code: Code: function submit() And then my view: Code: <?php if(validation_errors()): ?> The flashdata session doesn't seem to actually get set. Is it set up so that the flashdata is dumped before it's redirecting to the root page? Please go easy on me, I'm new to both CI and php.. Thanks, Some help with flashdata and form_validation - El Forum - 03-16-2009 [eluser]jedd[/eluser] Welcome to the CI forums. Quote:The flashdata session doesn't seem to actually get set. Is it set up so that the flashdata is dumped before it's redirecting to the root page? This is almost definitely what's happening. If you have a read of the [url="http://ellislab.com/codeigniter/user-guide/libraries/sessions.html"]CI User Manual[/url] - about two-third the way down that page it talks about how you can keep your flashdata through more than one page load. Can you give that a go? |