Page 1 of 1

sequential forms and skipping steps

Posted: Thu Mar 03, 2011 10:55 am
by fcarpio
Hello,
I am sorta new to PHP and I have hit a brick wall in the design of an app I am working on. This is the situation, I have a sequence of forms that request some information from the user. At one point I have a for in the road where it goes to BIO, CHEM, RAD or STD. For BIO and CHEM I need to get additional information, for RAD and STD I need to skip the additional information. something like this:

<Page 1>
radio btn BIO
radio btn CHEM
radio btn RAD
radio btn STD
btn Next
</Page 1>

<Page 2>
Have a switch case to display each form depending whether my user selected BIO, CHEM, RAD or STD. But how do I skip RAD and STD and go on to the next page while carrying the type (BIO, CHEM, RAD or STD) information?
</Page 2>

:idea:

It think it just hit me. I was using a single page to handle all the situations but I think I am going to have each option on page 1 go to different pages. The only thing I am not too crazy about is that each option will be a <form> and I would have to have 4 buttons.

Any ideas to make this better?

BTW, hi! I am new here.

Re: sequential forms and skipping steps

Posted: Thu Mar 03, 2011 11:07 am
by social_experiment
fcarpio wrote:But how do I skip RAD and STD and go on to the next page while carrying the type (BIO, CHEM, RAD or STD) information?
Do you want to ignore any 'input' (or choice) that is RAD or STD? You have the right idea with switch

Code: Select all

<?php
 switch($option) {
  case('BIO'):
  //do something
  break;
  case('CHEM'):
  // do something
  break;
  default:
  // do someting else
 }
?>