Php 没有指定输入文件。godaddy上的错误代码点火器
我在godaddy的子目录中安装了一个Codeigniter,url是 登录页面可以正常打开,但当我单击登录按钮或访问任何其他控制器时,都不会显示指定的输入文件。我在westlinebuilders.com/westlinecrm目录中没有任何.htaccess文件,我尝试创建新的htaccess文件并将其放入westlinecrm目录中,并按照有关如何使用谷歌搜索修复无文件输入错误的说明进行操作,但到目前为止运气不佳,有人能在这方面帮助我吗 我的verifylogin.php控制器代码是Php 没有指定输入文件。godaddy上的错误代码点火器,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我在godaddy的子目录中安装了一个Codeigniter,url是 登录页面可以正常打开,但当我单击登录按钮或访问任何其他控制器时,都不会显示指定的输入文件。我在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; } } } ?>
您的url解析方法错误。请尝试使用
为什么不使用simple.htaccess代码
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /westlinecrm/index.php?/$1 [L]
代码中的另一个问题..应用注释是错误的
function index() { //This method will have the credentials
validation $this->load->library('form_validation');
正道
function index() { //This method will have the credentials
validation
$this->load->library('form_validation');
我通过使用以下
.htaccess
规则使其工作
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /crm/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^index.php/(.*)$ [L]
</IfModule>
重新启动发动机
数据库/客户关系管理/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
重写规则^index.php/(.*)$[L]
我已经创建了一个子域,将所有模型文件的第一个字符重命名为小写,现在它的工作方式是用这个覆盖项目根文件夹中.htaccess文件的内容
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
这会解决它。大多数情况下,是csrf引起的。我相信您在配置文件中将其设置为TRUE
让我知道它现在是否工作。我正在godaddy的子域中运行Codeignator。我尝试了上面所有的解决方案。但它不起作用。对我来说,
重写规则
造成了问题
重写规则
,这会产生问题
RewriteRule ^index.php/(.*)$ [L]
已更正重写规则
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>
选项+FollowSymLinks
重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[QSA,L]
我们可以查看您的验证登录名
控制器代码吗?您的主目录是否也包含Codeigniter项目?不,我的主目录包含Wordpress网站注释出索引函数中的所有代码,只需回显一下,然后检查控件是否在那里我已经完成了,但是它显示了相同的错误。除非他没有通过.htaccessfunction index()删除index.php,否则他的url是正确的。{//此方法将具有凭证验证$This->load->library('form\u validation');再次检查此代码。我已经在westlinecrm目录中创建了.htaccess文件,它给了我500个内部服务器错误。我还创建了子域,仍然存在相同的问题,有没有帮助人员?选项[QSA,L]
在使用CI 3的Godaddy服务器上对我有效。这对我也适用于使用CI 3的Godaddy服务器,Php 5.6.27