Welcome Guest, Not a member yet? Register   Sign In
Multi Page Form Logic
#11

[eluser]TheFuzzy0ne[/eluser]
Hang on. I just spotted a flaw. With individual controller methods, it might be easy for someone to jump midway into the form via a link someone sent them, address bar history, or by link tampering. You could add some logic into your other controller methods that will redirect the use to the first page if there's no data stored for them, be it in userdata or in the database, but keeping things in a single controller might keep things tighter for you.
#12

[eluser]Jesse Schutt[/eluser]
At this point I am using the session data to store the information, so like you mentioned, I could check to see if certain session variables are filled in. If not, I'll bump them back to the start.

If I were to run it in a single method, how do I make the breaks between the different views?
#13

[eluser]TheFuzzy0ne[/eluser]
You could use a series of if statements and test the userdata to see what's been submitted and what hasn't, but it's starting to sound complicated...

I'm going to change my mind and say that keeping everything separate would probably be best. You could just give each method the logic to tell whether the user has submitted the preceding page. Checking for userdata that should have been set previously should do it, and you can redirect if they are trying to bypass. I say this because there will be a problem with using the back button if your use a single controller method, and I'd assume you want to give your visitors the chance to go back if they need to.
#14

[eluser]Jesse Schutt[/eluser]
Can you tell me how I should move from function to the next function? Should I use the "redirect(controller/function)" method?
#15

[eluser]TheFuzzy0ne[/eluser]
I consider redirects an absolute must whenever forms are submitted, as it can prevent resubmission of data.




Theme © iAndrew 2016 - Forum software by © MyBB