我有這樣的發送HTML文件的意見
public function main_page() {
$username = $this->input->post('username');
$password = $this->input->post('password');
$userID = $this->girismodel->girisKontrol($username, $password);
$data = array();
if (!$userID) {
$this->session->set_flashdata('login_error', TRUE);
redirect('http://' . site_url() . 'giris/');
$data['menu'] = $this->load->view('anasayfa/bLogin', '', true);
} else {
$this->session->set_userdata(array(
'logged_in' => TRUE,
'userID' => $userID,
'username' => $username));
$data['menu'] = $this->load->view('anasayfa/aLogin', '', true);
redirect('http://' . site_url());
}
$this->load->view('welcome_message', $data);
}
會話控制器,當你在上面的代碼中看到,如果會議是不行的,它加載到$數據[「菜單」] = bLogin.php 否則aLogin.php
後,我通過這WELCOME_MESSAGE,我嘗試使用
echo $menu
我認爲這可能是廢話是有沒有其他辦法?因爲它給了錯誤:
Undefined variable: menu
我刪除它。還是行不通 – 2012-03-01 14:13:55