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:
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:
<?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
?>
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:
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?
UPDATE:
I had the following error (i use from chorme and by Ctrl+Shift+j i get this alert):
Failed to load resource: the server responded with a status of 404
(Not Found)
And i fix it (Now i do not have the error) but still is same problem in display message. what do i do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…