[英]CodeIgniter 404 Bad request error
I'm working with codeIgniter. 我正在使用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. 但这是我的login.php文件,您可以看到validate_credentials()确实存在。
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.
我应该进入“ members_area”页面,因为我知道输入的信息是正确的。
Any help would be much appreciated. 任何帮助将非常感激。
what is this?? 这是什么??
/waitronmain /login.php/
login/validate_credentials / waitronmain
/login.php/
login / validate_credentials
login.php should be not in url i think you should do: login.php应该不在url中,我认为您应该这样做:
/waitronmain/login/validate_credentials
(assuming you removed index.php from urls and you are inside the waitronmain/ root ) (假设您从网址中删除了index.php,并且您位于waitronmain / root目录下)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.