Page 1 of 1

submit form in codeigniter blues.

Posted: Wed Sep 25, 2013 11:54 am
by eoinahern

Code: Select all

<form action="<?php echo base_url()?>login" method="post">
			
			<div class="input-prepend"><span class="add-on"><i class="icon-envelope"></i></span>
			<input type="text" id="" name="" placeholder="your@email.com">
			</br>
			</br>
			<div class="input-prepend"><span class="add-on"><i class="icon-lock"></i></span>
			<input type="password" id="" name="" placeholder="Password">
			</br>
			</br>
	        <button type="submit" class="btn btn-primary">
            <i class="icon-user icon-white"></i>Sign in
            </button>
	
			</div>
[text] trying to submit this is giving me issues. index page loads which contains the above view. but when i submit . i get requested URL not found on this server
. then if i use the full url action="<?php echo base_url()?>application/controllers/user/login" i get a forbidden, dont have permission to access.

my method in my controller class is just to load the next view on submit so i dont think there is an issue there . below is the controller [/text]

Code: Select all

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User extends CI_Controller {

	

	
	public function index()
	{
		
		if(!$this->isLoggedIn())
		{
		$this->load->view('mainview');
		}
		else
		{
		//do something
		}
		
	}
	
	
	public function login()
	{
	$this->load->view('carerview');
     
	}
	
	
	
	public function isLoggedIn()
	{
	return false;
	}
	
}

[text]any help would be appreciated thanks. [/text]

Re: submit form in codeigniter blues.

Posted: Wed Sep 25, 2013 12:16 pm
by Celauran
Have you checked the rendered HTML to be sure the form action is correct? Do you have a matching route setup?

Re: submit form in codeigniter blues.

Posted: Wed Sep 25, 2013 12:23 pm
by eoinahern
the page source looks fine. what do you mean by a matching route?