Welcome Guest, Not a member yet? Register   Sign In
Multi form question
#1

[eluser]tim1965[/eluser]
Hi i have a newbie question (which i know is very simple and maybe i having a stupido day, not again !!!)
So i have a multi form registration process, that will store the data for each form in a table as the form is submitted (temp tables until all data is captured), before caling the next form in the process.
I want to keep seperate controllers for each form (for validation and insert) if possible. My first form is correclty set up and i can validate and insert the data. So my stupido question is how do i call the next controller to process form 2 ?
I cannot use $this>load. Should i be calling an uri from my controller 1 to call my controller 2 ?
Many thnaks for your help.
#2

[eluser]GSV Sleeper Service[/eluser]
yeah, you can just redirect() from one controller to another.
I've recently done something similar, but my registration process steps were different methods in the same controller. (different controllers for each step seems overly complicated to me...) example below
Code:
class Registration extends MY_Controller {

    function index(){
        $this->stage1();
    }

    function stage1(){
        //display part 1 form

        //run validation
        //is it valid?
        redirect('registration/stage2');
    }

    function stage2(){
        //display part 2 form
        //run validation
        //is it valid?
        redirect('registration/stage3')
    }

    ...
}
#3

[eluser]tim1965[/eluser]
Excellent thanks for the response




Theme © iAndrew 2016 - Forum software by © MyBB