0

I'm working with codeIgniter. I am making a login form which checks the members details with the database.

However when I click to login I get this error message:

The requested URL /waitronmain/login.php/login/validate_credentials was not found on this server.

However this is my login.php file and as you can see validate_credentials() does exist.

class Login extends CI_Controller{


function index()
{
    $data['main_content'] = 'login_form';
    $this->load->view('includes/template', $data);
}

function validate_credentials()
{
    //load model to query db
    $this->load->model('membership_model');
    $query = $this->membership_model->validate();

    if($query){ //if credentials validated
        $data = array(
            'username' => $this->input->post('username'),
            'is_logged_in' => true

            );

            $this ->session->set_userdata($data);
            redirect('site/members_area');
    }

    else{ //if not validated load login form again.
        $this->index();

    }

}

}

Any idea what's going wrong? I should be going on to the 'members_area' page as I know the details I am entering are correct.

Any help would be much appreciated.

4

1 回答 1

0

这是什么??

/waitronmain/login.php/登录/validate_credentials

login.php 不应该在 url 我认为你应该这样做:

/waitronmain/login/validate_credentials

(假设您从 url 中删除了 index.php 并且您在 waitronmain/ root 中)

于 2013-02-14T19:14:09.413 回答