Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to display flash messages in Codelgniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 113
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: