form code:
<form method="post" action="<?php echo site_url('AddController/submit_data'); ?>" name="data_register">
<label for="Name">Enter you name</label>
<input type="text" class="form-control" name="username" required >
<br>
<label for="Email">Enter you Email</label>
<input type="email" class="form-control" name="email" required>
<br>
<label for="Sex">Select Sex</label><br>
<input type="radio" name="sex" checked value="Male" required > Male
<input required type="radio" name="sex" value="Female" > Female
<br><br>
<label for="Email">Address</label>
<textarea name="address" class="form-control" rows="6" required ></textarea>
<br><br>
<button type="submit" class="btn btn-primary pull-right">Submit</button>
<br><br>
</form>
controller:
class Addcontroller extends CI_Controller
{
public function __construct()
{
parent :: __construct();
$this->load->helper('url');
}
public function index()
{
// $this->load->view('add');
$this->load->view('add');
}
public function submit_data()
{
print_r($_POST);die();
$data = array('username' => $this->input->post('username'),
'email' => $this->input->post('email'),
'sex' => $this->input->post('sex'),
'address' => $this->input->post('address'),
'created_date' => date("m/d/y h:i:s"),
'status' => 'Y');
}
}
please reply me any one what is the reason i can’t submit my form
contoller page through 404 error
this is my url http://localhost/project/codeigniter/index.php/AddController/submit_data