I'm having issues with submitting forms in Codeigniter. When I click the submit button to log in, it routes to a URL like this: domain.com/www.domain.com/home/login. Obviously, it should just be www.domain.com/home/login.
This seems to be a similar problem to this question: Code Igniter URL appending, but that user was using regular forms, whereas I am using the CodeIgniter forms. In his question, using CodeIgniter forms was the correct answer to fix this issue, however, I'm still having the same issue he was.
My base_url() is already set in the configuration, and I've tried both
$this->load->view('/home/home');
and
$this->load->view('home/home');
in the controller function. I still get the same thing every time.
Even when the function is empty, and is literally just
public function login(){}
I still get the double domain issue.
As it may be relevant, here is my .htaccess file:
RewriteEngine On
RewriteBase /eventCentral/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
The RewriteBase is necessary, as this is a mock site piggybacking on my main site.
Here is the code for the form_open tag:
echo form_open('home/login');
echo form_input($userNameField);
echo form_password($passwordField);
echo form_submit($submitButton);
echo form_close();
I've also tried the form open tag as: echo form_open('/home/login');
and it still gives me the same issue.
My base_url is:
$config['base_url'] = 'www.redwolff.info/eventCentral';
The only route I have changed is is
$route['default_controller'] = 'Home';
The rest are all what they were before.