没有输入文件中指定。在GoDaddy的错误codeigniter [英] No input file specified. error codeigniter on godaddy

查看:124
本文介绍了没有输入文件中指定。在GoDaddy的错误codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个安装了codeigniter在godaddy的里面一个子目录,网址是 http://westlinebuilders.com/ westlinecrm /

在登录页面打开正常,但是当我点击登录按钮,或者如果我访问任何其他控制器,它让我没有指定的输入文件。我没有westlinebuilders.com/westlinecrm目录内的任何.htaccess文件中,我试图创造新的htaccess文件,并把它westlinecrm目录内,并遵循有关如何使用谷歌搜索来修复任何文件输入错误的指令,但没有运气到目前为止,可以请人帮助我在这?

我verifylogin.php控制器code是

 < PHP如果(!定义(BASEPATH'))出口('没有直接的脚本访问
 允许');

 类VerifyLogin扩展是CI_Controller {

  功能__construct(){父:: __结构();
 $这个 - >负载>模型('用户','',TRUE); }

  功能指数(){//这个方法将有凭据
 验证$这个 - >负载>库('form_validation');

    $这个 - > form_validation-> set_rules('要求'电子邮件,电子邮件);
 $这个 - > form_validation-> set_rules('密码','密码',
 修剪|需要| xss_clean | callback_check_database');

    如果($这个 - > form_validation->运行()== FALSE){
      //现场验证失败和放大器; NBSP;用户重定向到登录页面$这个 - >负载>帮手(URL);
         $这个 - >负载>帮手(HTML); $这个 - >负载>查看('模板/头');
      $这个 - >负载>查看('模板/菜单);
      $这个 - >负载>查看(客户端/登录表单'); $这个 - >负载>查看('模板/页脚); }    其他    {
      //转到私有区
      重定向(摘要,刷新); }

  }

  功能check_database($密码){//现场验证
 成功和放大器; NBSP;验证对数据库$用户名=
 $这个 - >输入 - >后期(电子邮件);

    //查询数据库$结果= $这个 - >用户自>登录($的用户名,
 $密码);

    如果($结果){
      $ sess_array =阵列();
      的foreach($结果为$行)
      {
        $ sess_array =阵列(
          'ID'=> $行向> ID,
          电子邮件=> $行向> email1
        );
        $这个 - >会话级> set_userdata('LOGGED_IN',$ sess_array);
      }
      返回TRUE; }    其他    {
      $这个 - > form_validation-> set_message('check_database,无效的用户名或密码');
      返回false; ?}}}>
 

解决方案

我正在运行的codeignitor在godaddy的一个子域。我想最重要的解决方案。但是,这是行不通的。对我来说,重写规则使得问题。

重写规则这使得问题

 重写规则^ index.php文件/(.*)$ [L]
 

修正重写规则

 重写规则^(。*)$的index.php?/ $ 1 [QSA,L]
 

所以工作的.htaccess code是如下。

 < IfModule mod_rewrite.c>
选项​​+的FollowSymLinks
RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$的index.php?/ $ 1 [QSA,L]
< / IfModule>
 

I have a installed Codeigniter on godaddy inside a subdirectory, the url is http://westlinebuilders.com/westlinecrm/

the login page opens fine, but when i click on login button or if i access any other controller it shows me No input file specified. i dont have any .htaccess file inside westlinebuilders.com/westlinecrm directory, i tried creating new htaccess file and put it inside westlinecrm directory and followed the instructions on how to fix no file input error using google search, but no luck till now, can anyone please help me on this?

my verifylogin.php controller code is

 <?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.&nbsp; 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.&nbsp; 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;    }  } } ?>

解决方案

I am running the codeignitor in a subdomain in the godaddy. I tried all the solutions above. But it doesn't work. For me the RewriteRule makes the problem.

RewriteRule which makes problem

RewriteRule ^index.php/(.*)$ [L]

Corrected RewriteRule

RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

So the working .htaccess code is below.

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>

这篇关于没有输入文件中指定。在GoDaddy的错误codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆