diff --git a/application/controllers/Forms.php b/application/controllers/Forms.php index 18144ef..0920a43 100644 --- a/application/controllers/Forms.php +++ b/application/controllers/Forms.php @@ -8,10 +8,23 @@ class Forms extends CI_Controller redirect('users/login'); } $data['title'] = 'Create Post'; - $this->load->view('templates/header'); + $this->load->view('templates/header'); $this->load->view('forms/create', $data); $this->load->view('templates/footer'); } + + public function submit_form() { + $formData = $this->input->post('formData'); + $decodedData = json_decode($formData, true); + + // Process the form data here + // Example: Save the form data to the database + + $this->load->model('Form_model'); + $this->Form_model->save_form_data($decodedData); + + echo json_encode(['status' => 'success', 'message' => 'Form data submitted successfully']); + } } diff --git a/application/models/Form_model.php b/application/models/Form_model.php new file mode 100644 index 0000000..e69de29 diff --git a/application/views/forms/create.php b/application/views/forms/create.php index 961e3b7..6229b97 100644 --- a/application/views/forms/create.php +++ b/application/views/forms/create.php @@ -1,75 +1,74 @@ -