没有输入文件中指定。在GoDaddy的错误codeigniter

编程入门 行业动态 更新时间:2024-10-22 23:37:49
本文介绍了没有输入文件中指定。在GoDaddy的错误codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

在登录页面打开正常,但是当我点击登录按钮,或者如果我访问任何其他控制器,它让我没有指定的输入文件。我没有westlinebuilders/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 westlinebuilders/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/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

本文发布于:2023-10-31 15:46:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546546.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   文件   GoDaddy   codeigniter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!