【发布时间】:2014-02-06 08:51:10
【问题描述】:
我在godaddy上的一个子目录中安装了Codeigniter,网址是http://westlinebuilders.com/westlinecrm/
登录页面打开正常,但是当我单击登录按钮或访问任何其他控制器时,它显示没有指定输入文件。我在 westlinebuilders.com/westlinecrm 目录中没有任何 .htaccess 文件,我尝试创建新的 htaccess 文件并将其放在 westlinecrm 目录中,并按照有关如何使用谷歌搜索修复无文件输入错误的说明进行操作,但到目前为止还没有运气,可以有人请帮我吗?
我的 verifylogin.php 控制器代码是
<?php if ( ! defined('BASEPATH')) exit('No direct script access
allowed');
class VerifyLogin extends CI_Controller {
function __construct() { parent::__construct();
$this->load->model('user','',TRUE); }
function index() { //This method will have the credentials
validation $this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('password', 'Password',
'trim|required|xss_clean|callback_check_database');
if($this->form_validation->run() == FALSE) {
//Field validation failed. User redirected to login page $this->load->helper('url');
$this->load->helper('html'); $this->load->view('templates/header');
$this->load->view('templates/menu');
$this->load->view('client/loginform'); $this->load->view('templates/footer'); } else {
//Go to private area
redirect('summary', 'refresh'); }
}
function check_database($password) { //Field validation
succeeded. Validate against database $username =
$this->input->post('email');
//query the database $result = $this->user->login($username,
$password);
if($result) {
$sess_array = array();
foreach($result as $row)
{
$sess_array = array(
'id' => $row->id,
'email' => $row->email1
);
$this->session->set_userdata('logged_in', $sess_array);
}
return TRUE; } else {
$this->form_validation->set_message('check_database', 'Invalid username or password');
return false; } } } ?>
【问题讨论】:
-
我们可以查看您的
verifylogin控制器代码吗? -
您的主目录是否也包含 Codeigniter 项目?
-
不,我的主目录包含 Wordpress 网站
-
注释掉索引函数中的所有代码,然后回显 somethis 并检查控件是否到达那里
-
我已经完成了,但它显示相同的错误
标签: php .htaccess codeigniter