CodeIgniter Forums
Flash_data problem - 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 problem (/showthread.php?tid=27410)



Flash_data problem - El Forum - 02-09-2010

[eluser]brixxster[/eluser]
Hello everyone.

I have a form which gets data from the user. I use the CI validation function to validate if the user enters the correct data and I use flash_data to display errors right after validating the data inputted from the database. The CI validation works fine and I am only having a problem with flash_data. The question is, why does the user have to click the form twice in order to have the flash_data finally displayed?


CONTROLLER
Code:
if ($emailCheck != Null){
    echo $emailCheck[0]->email;
} else {
    $this->session->set_flashdata('resetMsg', 'Email not found in database.');
    $this->index();
}

VIEW
Code:
<?php if($this->session->flashdata('resetMsg')) : ?>
    <div class="error">&lt;?php echo $this->session->flashdata('resetMsg');?&gt;</div>
&lt;?php endif; ?&gt;

Thanks Smile


Flash_data problem - El Forum - 02-09-2010

[eluser]Ben Edmunds[/eluser]
Hey brixxster,

I also ran into this problem once but don't remember what I did to correct it if I ever did...

Well, it is flashdata, what do you get if you redirect to index instead of just calling it?