I am new into Codeigniter programming. I started CI by simply editing my default controller welcome. I added a function into the controller which is called on clicking a submit button. I havent done any modification in the default framework or in the config files. But upon clicking the submit button, the application returns a 404 response. Not Found The requested URL /login/welcome/main was not found on this server. Apache/2.2.14 (Ubuntu) Server at localhost Port 80
The main function is what I wrote in the welcome controller. Can anyone please tell me what is wrong. My Codeigniter version is 2.1.0. I re installed Apache and PHP. But no use still same. The code from controller and the welcome page below.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
error_reporting(E_ALL);
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('login_page');
//$this->load->view('phpinfo');
}
public function main()
{
$this->load->view('phpinfo');
}
And the welcome page is
<div id="container">
<h1>Ignitor</h1>
<div id="body">
<code>Please Login to continue. </code>
<div id="login_form">
<?php echo form_open(base_url().'welcome/main');?>
<ul>
<li>
<label>Username </label>
<?php echo form_input(array('id' => 'username', 'name' => 'Username'));?>
</li>
<li>
<label>Password </label>
<?php echo form_password(array('id' => 'password', 'name' => 'Password'));?>
</li>
<li> <?php echo form_submit(array('id'=>'submit'),'Let me in' )?></li>
</ul>
<?php echo form_close();?>
*/