controller file as like below
registration.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Registration extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('user'); } function index() { $this->load->view("reg_view.php"); } public function registration() { $this->load->library('form_validation'); $this->form_validation->set_rules('user_name', 'User Name', 'trim|required|min_length[4]|xss_clean'); if($this->form_validation->run() == FALSE) { $this->index(); } else { //database insertion } } } ?> |
view file as below
reg_view.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<div id="testme"> <div class="reg"> <div class="my_title">Sign Up</div> <?php echo validation_errors('<p class="error">'); ?> <?php echo form_open("registration/registration"); ?> <p> <label for="user_name">User Name:</label> <input type="text" id="user_name" name="user_name" value="<?php echo set_value('user_name'); ?>" /> </p> <p> <input type="submit" class="greenButton" value="Submit" /> </p> <?php echo form_close(); ?> </div> </div> |
when i click on the submit button nothing happens
Solution is below
Please Use capital letter for the controllername
1 |
<?php echo form_open("Registration/registration"); ?> |