I'm creating php system using codeigniter framework. I'm using basic framework without any templates. When I submit data from html page to controller to save to db after redirecting with the error message to view file, i can't remove the url that i used to save data in controller file. How I solve this problem?
This is the form i used to send data to controller.
<form role="form" action="save_user_type" method="POST" >
<div class="row">
<div class="form-group col-md-6">
<label>User Type</label>
<input type="text" class="form-control" name="type" id="type" placeholder="Enter ...">
</div>
</div>
<div class="row">
<div class="form-group col-md-6"></div>
<div class="form-group col-md-6">
<button type="submit" class="btn default">Save</button> <button type="button" class="btn default">Reset</button>
</div>
</div>
</form>
This is the controller function i called.
function save_user_type(){
try {
$this->load->model('Configuration/Configuration_model');
if($this->Configuration_model->save_types() == 1){
$success['done'] = "Good Job";
}else{
$success['dont'] = "Error";
}
$this->load->view('template/header');
$this->load->view('template/menubar');
$this->load->view('configuration/user/index',$success);
} catch(Exception $exc){
return $exc->getTraceAsString();
}
}
Please Help me to solve this problem.