wincen Posted November 6, 2007 Share Posted November 6, 2007 I'm writting my own php app using a front controller and MVC. For something simple like site registration i have 1 registration model, view, and controller. i want the registration to be done in 3 steps. doing that is easy enough, but i'm wondering what is the best way to store the data the user enters in step 1 and carry it over to step 2? currently the front controller creates a new registration controller on each time the user goes to the next step. the registration controller creates a new model. the old model's information is then lost. how do experienced php developers deal with this? do you store all user registration information in session variables to the end? do you actually make database updates after each step? is there another solution that i am compeltely missing? Quote Link to comment Share on other sites More sharing options...
trq Posted November 6, 2007 Share Posted November 6, 2007 [currently the front controller creates a new registration controller on each time the user goes to the next step. the registration controller creates a new model. the old model's information is then lost. The simplest method is to store each step in the $_SESSION array. Either that, or pass the data around in hidden forms. Quote Link to comment Share on other sites More sharing options...
wincen Posted November 6, 2007 Author Share Posted November 6, 2007 The simplest method is to store each step in the $_SESSION array. Either that, or pass the data around in hidden forms. so in each step i would have a session variable like $_SESSION['name'], $_SESSION['email'], etc etc? it is straight forward, but it seems like it could get huge depending on what's required during registration. when you say store each step in a $_SESSION array does that mean you can put the entire dataObject into a session variable? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.