lundi 26 décembre 2016

Include files using condition of session

I have 4 types of users in my system. So i have to include header files using conditions.

I tried below code.

if($this->session->userdata('email_admin')){
     include('header_admin');
}
if($this->session->userdata('email_zone_manager')){
     include('header_zone_manager');
}
if($this->session->userdata('email_state_manager')){
     include('header_state_manager');
}
if($this->session->userdata('email_user')){
    include('header_user');
}

When i tried with echo something and exit() its working means condition works file but header css and js etc. are not including.

   if($this->session->userdata('email_admin'))
   {    
        echo "Admin";
        include('header_admin');
   }

Above code echo "Admin" but header_admin's contents are not including.

Aucun commentaire:

Enregistrer un commentaire