I am new to codeigniter. While submitting the form i am getting 404 error page not found.Actually without entering the username and password it should work the valudations. Here is the code.
login.php in controller
public function verifyuser()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username','username','required');
$this->form_validation->set_rules('password','password','required');
if($this->form_validation->run() == FALSE){
$this->load->view('login/login');
}else{
$this->load->model('login/validate');
}
}
*login/login.php*
<?php echo form_open('verifyuser'); ?>
<!-- start login-inner -->
<div id="login-inner">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<th>Username</th>
<td><input type="text" name="username" class="login-inp" /></td>
</tr>
<tr>
<th>Password</th>
<td><input type="password" name="password" value="************" onfocus="this.value=''" class="login-inp" /></td>
</tr>
<tr>
<th></th>
<td valign="top"><input type="checkbox" class="checkbox-size" id="login-check" /><label for="login-check">Remember me</label></td>
</tr>
<tr>
<th></th>
<td><input type="submit" value="submit" class="submit-login" /></td>
</tr>
</table>
</div>
If you’re intending to submit to the same controller you’re on, you don’t need to specify anything in
form_open:This should be enough. CI will automatically use the current controller/method when nothing is specified. Furthermore, the reason you’re getting the error is because you’re telling
form_openthat you want to load the controller/methodverifyuser/index.