05-18-2008, 05:56 PM
[eluser]jenie_net[/eluser]
Hi all!
I've got a controller Login.php
This works well until i leave comments on this parts
If i delete comments, i have a blank screen while attempting to
http://mysite.com/index.php/login
(The strange thing is that i'm in index() while i call login without parameters...
and the code is in authenticate function..)
Any help?
Thanks in advance...
Stefano Marino
Hi all!
I've got a controller Login.php
Code:
<?php
class Login extends MY_Controller {
function Login()
{
parent::MY_Controller();
$this->load->helper('security');
$this->load->helper('form');
$this->load->model('User_model');
}
function index()
{
$this->_header_ajax('Authentication required:');
$this->load->view('public/login_view');
$this->_footer();
}
function authenticate(){
$data = array(
'username' => $this->input->post('username', TRUE) ,
'password' => $this->input->post('password', TRUE),
);
$result=$this->User_model->authenticateUser($data);
if ($result != NULL ){
/* Settare gli attributi di sessione */
/* $res_sess = array(
'logged_in' => TRUE
'role' => $result->role;
);
$this->session->set_userdata($re_sess); */
redirect('protected','refresh');
}
else{
$this->index();
}
}
}
?>
This works well until i leave comments on this parts
Code:
/* $res_sess = array(
'logged_in' => TRUE
'role' => $result->role;
);
$this->session->set_userdata($re_sess); */
If i delete comments, i have a blank screen while attempting to
http://mysite.com/index.php/login
(The strange thing is that i'm in index() while i call login without parameters...
and the code is in authenticate function..)
Any help?
Thanks in advance...
Stefano Marino