Welcome Guest, Not a member yet? Register   Sign In
Flash_data problem
#1

[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
#2

[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?




Theme © iAndrew 2016 - Forum software by © MyBB