Welcome Guest, Not a member yet? Register   Sign In
Codeigniter “No input file specified.” error when submitting form?
#1

[eluser]ErinKabbash[/eluser]
I am stuck and cannot seem to figure my issue out. I am trying to write a basic "Contact Us Form" using Codeigniter for the first time. My form on my view looks like this..

Code:
<div  left; padding-right: 55px; padding-left: 35px;'>
    &lt;?php
        $this->load->helper('form');
        echo form_open('pages/emailsender'); ?&gt;

        Contact Us:<br />
        &lt;?php
        echo form_input('name', 'Enter Your Name');
        echo form_input('email', 'Enter Your Email');
        echo "<br />";
        echo form_textarea('message', 'Enter your message here, thanks for taking the time to contact us!');
        echo "<br />";
        echo form_submit('submit', 'Send Message!');
        echo form_reset('reset', 'Reset Form');
        echo form_close();
        ?&gt;
</div>

and my controller pages.php looks like this..

Code:
&lt;?php

class Pages extends CI_Controller {

    public function index(){

        $this->load->view('templates/header');
        $this->load->view('home');
        $this->load->view('templates/footer');
    }

    public function home(){

        $this->load->view('templates/header');
        $this->load->view('home');
        $this->load->view('templates/footer');
    }

    public function about(){

        $this->load->view('templates/header');
        $this->load->view('about');
        $this->load->view('templates/footer');
    }

    public function services(){

        $this->load->view('templates/header');
        $this->load->view('services');
        $this->load->view('templates/footer');
    }

    public function reviews(){

        $this->load->view('templates/header');
        $this->load->view('reviews');
        $this->load->view('templates/footer');
    }

    public function specials(){

        $this->load->view('templates/header');
        $this->load->view('specials');
        $this->load->view('templates/footer');
    }

    public function contact(){

        $this->load->view('templates/header');
        $this->load->view('contact');
        $this->load->view('templates/footer');
    }

    public function emailsender(){
        $this->load->view('templates/header');
        $this->load->view('contact');
        $this->load->view('templates/footer');
    }

}

I have the "emailsender" function just redirecting me back to the same page as a test, but it won't even do that?! I get a "No input file specified." error every time.

My config file looks like this..

Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = 'http://mywebsitename.com';
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";

any finally my .htaccess looks like this..

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

When I click on the submit button for the form it sends me to /index.php/pages/emailsender and displays the "No input file specified." Error. I am using a GoDaddy Server, not sure if that makes a difference.
#2

[eluser]WanWizard[/eluser]
That makes a world of difference. Just Google "codeigniter godaddy no input file" and you know why...
#3

[eluser]ErinKabbash[/eluser]
I have Googled the issue and posted to multiple forms. Can you please describe the solution? I have tried to change my .htaccess file as suggested on Google and also tried to edit the config.php file as stated on Google. Neither seems to fix the issue?

My .htaccess is (Includes the ? after index.php as suggested on google)..

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1

In my config.php I have..

$config['base_url'] = 'http://mysite.com';
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";

#4

[eluser]ErinKabbash[/eluser]
After hours of banging my head against the wall I solved my own problem.. you need to use the direct link instead of the short hand of the form open tag.. like this..

echo form_open('http://mysite.com/welcome/emailsender');

instead of this..

echo form_open('welcome/emailsender');
#5

[eluser]Tpojka[/eluser]
I don't know if you have different practice, but everyone I saw coding (including myself) is using forslash at the end in value for base_url key:
Code:
$config['base_url'] = 'http://site.tld/';
If no other reason not to, I suggest this way.
#6

[eluser]CroNiX[/eluser]
@Tpojka, yeah that's correct. It even states that right there in the config file notes where you set it in config (which the OP copy/pasted):
Quote:URL to your CodeIgniter root. Typically this will be your base URL, WITH a trailing slash: http://example.com/

The CI internal functions depend on it being set correctly, WITH the trailing slash. Unless that is fixed, you can expect problems elsewhere.




Theme © iAndrew 2016 - Forum software by © MyBB