Welcome Guest, Not a member yet? Register   Sign In
“flashdata” doesn't work
#1

[eluser]SaSa[/eluser]
I use CodeIgniter 2.1.0, i want after insert data in database get a message like "Your information was successfully updated.". For this work i have in CI_Controller following function:

Code:
function myCiInser(){
... Here is my query ...
//$data: this var is result query that is true
if($data){
    $this -> session -> set_flashdata('message', 'Your information was successfully updated.');
    redirect('url/myurl');
            }
}
And i have in view as:

Code:
<?php
$message = $this->session->flashdata('message');
    if($message){
        echo '<div id="error_text">' . $message . '</div>';
    }
//I test this : "echo $message;" but don't give output
?&gt;
But i don't give message in view but redirect is done and work true. and in database in table ci_sessions column user_data i have this:

Code:
a:2:{s:9:"user_data";s:0:"";s:19:"flash:new:message";s:42:"Your information was successfully updated.";}
How can fix this problem?




Theme © iAndrew 2016 - Forum software by © MyBB