Handling Form Data in CodeIgniter — a practical guide to CodeIgniter form data with clear examples you can reuse in real projects.
CodeIgniter Tutorial Series (23/74). Prefer one article? Read the complete CodeIgniter tutorial.
Short description
Use `getPost()` / `getVar()` and keep a clear flow: receive → validate → save → redirect with flash message.
Handle contact form
public function submit()
{
$data = [
'name' => $this->request->getPost('name'),
'message' => $this->request->getPost('message'),
];
// validate + save...
return redirect()->to('/contact')->with('success', 'Sent');
}