<input type="radio" name="secondPage[8]" value="3"/>3 <input type="radio" name="secondPage[8]" value="4"/>4 <input type="radio" name="secondPage[8]" value="5"/>5 <input type="radio" name="secondPage[8]" value="6"/>6 </div> <div class="button"> <input type="submit" name="secondPageSubmit" value="Go to Page 2 of 3" /> </div> </form> <?php } elseif (!empty($_POST["secondPageSubmit"]) && empty($_POST["thirdPageSubmit"])) { if (!empty($_POST["secondPage"])) { //echo '</br>saving second page</br>'; //echo 'lastId: '.$_POST['lastId']; $secondPage = $_POST['secondPage']; $vote->saveSecondPage($secondPage, $_POST['lastId']); } ?> <form name="thirdPage" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> " method="post"> <input hidden name="startSubmit" value="true"> <input hidden name="firstPageSubmit" value="true"> <input hidden name="secondPageSubmit" value="true"> <input hidden name="lastId" value="<?php echo $_POST["lastId"]; ?> ">