Welcome Guest, Not a member yet? Register   Sign In
validation and data afterwards
#4

[eluser]Hyra[/eluser]
Ah

well you could do something like this in your controller "form.php"

Pseudo code:

Code:
function index() {
   // show form
   $this->load->view("form.html");
}

function process() {
    // Get the posted stuff and do something
    // Use validation library
    
    // If everything is okay:
    $this->redirect("/form/success");
}

function success() {
     $this->load->view("form_success.html", $data);
}

By redirecting the user to a thank you page they can refresh that page but it will still only call /form/success/ so no data is being reprocessed. You can fill /form/process/ with whatever is needed to do with the received data.

If you hit the Back button from the success-page it should go to the form page (/form/index/) as it skips the header redirect which didnt produce any cachable data as you didn't output anything.

Hope this helps (and makes sense).


Messages In This Thread
validation and data afterwards - by El Forum - 03-03-2008, 07:25 AM
validation and data afterwards - by El Forum - 03-03-2008, 07:37 AM
validation and data afterwards - by El Forum - 03-03-2008, 07:41 AM
validation and data afterwards - by El Forum - 03-03-2008, 07:47 AM
validation and data afterwards - by El Forum - 03-03-2008, 08:35 AM
validation and data afterwards - by El Forum - 03-03-2008, 08:38 AM
validation and data afterwards - by El Forum - 03-03-2008, 08:40 AM
validation and data afterwards - by El Forum - 03-03-2008, 08:47 AM
validation and data afterwards - by El Forum - 03-03-2008, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB