CodeIgniter Forums
NewBie - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: NewBie (/showthread.php?tid=37231)



NewBie - El Forum - 01-03-2011

[eluser]Unknown[/eluser]
I am trying to create a login form in codeigniter. I am getting the form but when i submit, i am getting the error message page not found. Can anyone tell me how to solve this?


/* controllers/welcome.php */

class Welcome extends Controller{

function Welcome()
{
parent::Controller();
}

function index()
{
$this->load->view('login');
}

function login()
{
echo "I am here";
}

}

/* views/login.php */

<form method="post" action="welcome/login">
<input type="text" name="username" value="">
<input type="password" name="password" value="">
<input type="submit" name="submit" value="Submit">
</form>

Thanks


NewBie - El Forum - 01-03-2011

[eluser]InsiteFX[/eluser]
Did you read the CodeIgniter User Guide ?

CodeIgniter User Guide - Form Validation

InsiteFX


NewBie - El Forum - 01-03-2011

[eluser]Atharva[/eluser]
check your base_url in config.php Also you can try with
Code:
<form method=“post” action=“<?=base_url().index_page()?>welcome/login”>