First step

"; echo "Please choose the elements you want your form to have from below
"; echo "
Text Fields
Check Boxes
Radio Buttons
Lists
Text Areas
"; } //2nd step is to choose the quantity for each element function second() { echo "

Second step



"; echo "Please specify the quantity for each element
"; echo "
"; if( isset($_POST['textfield'])) { echo "How many text fields:
"; } if(isset($_POST['checkbox'])) { echo "How many check boxes:
"; } if(isset($_POST['radiobutton'])) { echo "How many Radio buttons:
"; } if( isset($_POST['list'])) { echo "How many Lists:
"; } if( isset($_POST['textarea'])) { echo "How many Text areas:
"; } echo ""; echo "
"; } //take names function third() { echo "

Third step



"; echo "Please insert the names for each field
"; echo "
"; if (isset($_POST['t_quantity'])) { echo "Names for text fields
"; for($i=1; $i<=$_POST['t_quantity']; $i++) { echo "Text field ".$i.":
"; } echo ""; } if(isset($_POST['c_quantity'])) { echo "
Names and question for check boxes
"; echo "Check boxes heading or question:
"; for($i=1; $i<= (int) $_POST['c_quantity']; $i++) { echo "checkbox ".$i.":
"; } echo ""; } if(isset($_POST['r_quantity'])) { echo "
Names and question/heading for radio buttons
"; echo "Radio buttons heading or question:
"; for($i=1; $i<= (int) $_POST['r_quantity']; $i++) { echo "Radio button ".$i.":
"; } echo ""; } if(isset($_POST['l_quantity'])) { echo "
Heading and names for the lists elements
"; for($i=1; $i<= (int) $_POST['l_quantity']; $i++) { echo "List no".$i." heading/ quantion/ name:
"; echo "List elements: "; echo "(separate each element with comma)
"; } echo ""; } if(isset($_POST['ta_quantity'])) { echo "
Names for the text areas
"; for ($i=1; $i<= (int) $_POST['ta_quantity']; $i++) { echo "Text area ".$i.":
"; } echo ""; } } function main() { if(isset($_POST['sub'])) { switch ($_POST['sub']) { case 'Goto 2nd Step'; second(); break; case 'Goto 3rd Step'; third(); break; case 'Create Form'; create(); break; case 'submit'; sub(); break; Default; echo 'Invalid value'; break; } //second();third();//create();sub(); } else first(); } main(); ?>