Hallo breadfish.de Comm,
ich hab ein Problem mit CodeIgniter ich kann keine userdata auslesen.
Fehler Quelle
PHP
<?php if ($this->session-get_userdata('is_logged_in') == 1){?>
<li><a href="<?php echo index_page()."/login";?>">Anmelden</a></li>
<li><a href="<?php echo index_page()."/regist";?>">Registrieren</a></li>
<li><a href="<?php echo index_page()."/eprofil";?>">Edit Profile</a></li>
<?php }else{?>
<?php }?>
Laut:
Code
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$session
Filename: templates/nav.php
Line Number: 23
Backtrace:
File: G:\xampp\htdocs\seite\application\views\templates\nav.php
Line: 23
Function: _error_handler
File: G:\xampp\htdocs\seite\application\controllers\pages.php
Line: 14
Function: view
File: G:\xampp\htdocs\seite\index.php
Line: 292
Function: require_once
Fatal error: Call to undefined function get_userdata() in G:\xampp\htdocs\seite\application\views\templates\nav.php on line 23
A PHP Error was encountered
Severity: Error
Message: Call to undefined function get_userdata()
Filename: templates/nav.php
Line Number: 23
Backtrace:
Alles anzeigen
und Controller:
Code
public function login_validation()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username','Username','required|trim|xss_clean|callback_validate_credentials');
$this->form_validation->set_rules('password','Password','required|sha1|trim');
if($this->form_validation->run()){
$data=array(
'username'=>$this->input->post('username'),
'is_logged_in'=>1
);
$this->session->set_userdata($data);
$this->session->set_userdata('is_logged_in', 1);
redirect('pages/members');
}else{
$this->load->view('login');
}
}
Alles anzeigen
ich bitte um Schnelle hilfe.
Mit Freundlichen Grüßen,
DarkEvolution