0

here is my code for simple validation but i can't able to why this happening but validation always fails no matter what i input?

<div class="signup-form"><!--sign up form-->
<h2>New User Signup!</h2>
<?php echo form_open('login/register');?>
    <input type="text" name="name" placeholder="Name"/>
    <input type="email" name="email" placeholder="Email Address"/>
    <input type="password" name="password" placeholder="Password"/>
    <button type="submit" class="btn btn-default">Signup</button>
</form>
</div><!--/sign up form-->

Here's my Conroller:

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

class Login extends CI_Controller{

    public function register(){
        $this->load->library('form_validation');
        $this->form_validation->set_rules('email','required|valid_email');
        $this->form_validation->set_rules('password','required');
        if($this->form_validation->run() === FALSE){
            $this->load->view('test.php');
        }
        else{
            $this->load->view('index.php');
        }
    }
}
2
Contributors
1
Reply
16
Views
2 Years
Discussion Span
Last Post by cereal
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.