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');
        }
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.