I am new to Code Igniter (as my first structure that I am learning).
I got this in my controller:
if ($this->form_validation->run() === FALSE) { $this->load->view('account/register', $data); } else { $data['message'] = $this->lang->line('account_created'); $this->register->insert_account(); $this->load->view('account/register_success', $data); }
If the form is successfully validated, it just changes the view, but you can still click the refresh button and resubmit the form data - this is not a big problem for me, as I check if the fields are unique, but it would be better for me to prevent re-submission form data.
Normally in pure PHP I would use header("Location: ..."); but I am loading the view here so that after the redirect, it will not be able to access - right?
Do you have any suggestion?
source share