Hello Friends,
If you are looking to set flash messages in Codelgniter framework. Please follow the below code for the same:
1) Open your controller function and put the below code to define flash message
$this->session->set_flashdata('msg', 'Invalid credential please try again!'); // define your flash message here
redirect('index.php/admin/index');
2) Now open your view file of this controller and place the below code to display flash messages:
<div class="alert alert-danger text-center">
<?php echo $this->session->flashdata('msg'); ?>
</div>
0 Comment(s)