我在 godaddy 的一个子目录中安装了 Codeigniter,url 是 http://westlinebuilders.com/westlinecrm/
登录页面打开正常,但是当我单击登录按钮或访问任何其他 Controller 时,它显示没有指定输入文件。我在 weSTLinebuilders.com/weSTLinecrm 目录中没有任何 .htaccess 文件,我尝试创建新的 htaccess 文件并将其放在 weSTLinecrm 目录中,并按照有关如何使用谷歌搜索修复无文件输入错误的说明进行操作,但直到现在都没有运气,可以有人可以帮我解决这个问题吗?
我的 verifylogin.php Controller 代码是
<?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; } } } ?>
最佳答案
我在 godaddy 的子域中运行 codeignitor。我尝试了上面的所有解决方案。但它不起作用。对我来说,RewriteRule
造成了问题。
RewriteRule
造成问题
RewriteRule ^index.php/(.*)$ [L]
更正了RewriteRule
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
下面是有效的 .htaccess
代码。
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
关于php - 未指定输入文件。 Godaddy 上的错误代码点火器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21178875/