Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:37:36+00:00 2026-06-13T11:37:36+00:00

i have login form like this log in to the application, it shows menu

  • 0

i have login form like this

enter image description here

log in to the application, it shows menu like this
enter image description here

it went fine until i click some menu, then it shows
enter image description here

here is the controller of the link that i clicked
i thought keuangan was already on the menu, but why does the keuangan not appear when i click some link of the menu ?

 function index()
{
    $data['title'] = 'QB Cash Advance Settlement';
    $this->load->view('menu',$data);
    $this->load->view('v/vcas');
}

here is the c_menu controller

function index()
{
    $data['title'] = "QB Dashboard";
    $data['jabatan'] = "Keuangan";
    $this->load->view('menu',$data);
    $this->load->view('body');
}

here is the menu_view

<div id ="user">Selamat datang, <?php echo $jabatan; ?></div>

the login controller

function login()
{   
    $username = $this->input->post('username');
    $jabatan = $this->input->post('jabatan');
    $this->form_validation->set_rules('username','Username','alpha_numeric|trim|required|xss_clean');
    $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|callback_check_database');

     if($this->form_validation->run() == FALSE)
     {
         $this->load->view('login');
 }
  else
 {

         if($jabatan == 'keuangan')
         {
                 redirect('c_menu','refresh');
         }
         else if ($jabatan == 'hd')
         {
             echo $jabatan;
         }
         else
         {
             echo $jabatan;
         }
 }

do i need to declare $data['title'] = 'keuangan' in every controller/index ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:37:37+00:00Added an answer on June 13, 2026 at 11:37 am

    The data you bind into the view will not persist. So it’s there when you load the menu the first time because you set it in the controller here:

    $data['jabatan'] = "Keuangan";
    $this->load->view('menu',$data);
    

    But then when you click on the link it goes to a different controller.

    $data['title'] = 'QB Cash Advance Settlement';
    $this->load->view('menu',$data);
    

    $data['jabatan'] is not set in this controller before binding $data into the view, so that’s why it is undefined.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that have standard form authentication declared, like this: <login-config>
I have WPF application that has a login form. I would like to make
I have a login form for my website. This login form have two text
I have this login form. This form is a grouped table view where the
I have written a login form, in this I have used, form and method
I have configured a form based log in in my JSF 2.0 Application on
I have created a login form. It works fine, but it goes back to
I have this Spring XML: <!-- Configure the authentication --> <security:http auto-config=true use-expressions=true> <security:form-login
I have a login form consisting of a Form with two TextInput's. I want
I have a login form which appears at the top of all of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.