Codeigniter - How to get form post data in controller?By Hardik Savani | December 12, 2018 | | 20508 Viewer | Category : PHP Codeigniter
Here, i will give you simple two way to get form post data in codeigniter 3 project. you can simply get all post data using $this->input->post() and $_POST using simple php stuff.
when i was working on my codeigniter 3 application and i try to get post data using $this->input->post() then i can't get value. i don't know it was not working, but i try to run with virtual domain and with localhost then it was working fine. So if you are trouble with getting form post data then it will help you.
public function formPost()
<form action="/formPost" method="POST" enctype="multipart/form-data">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email" name="email">
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter Name" name="name">
<button class="btn btn-success">Save</button>
I hope it can help you...
- PHP Codeigniter 3 - Create Dynamic Tree View using Bootstrap Treeview JS
- PHP Codeigniter 3 Google Recaptcha Form Validation Example
- PHP Codeigniter 3 Ajax Pagination using Jquery Example
- PHP Codeigniter 3 - Jquery Ajax Autocomplete Search using Typeahead
- Codeigniter 3 Datatables Ajax Example From Scratch
- Codeigniter 3 resize image and create thumbnail example
- Codeigniter 3 - Generate PDF from view using dompdf library with example
- Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL
- Codeigniter 3 - select2 ajax autocomplete from database example with demo