Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are various ways of managing this, depending on your ultimate goal.</p> <p>You can just use separate files, and when user submits the form, it goes to the next page, ie. firstform.php -> SUBMIT goes to -> secondform.php, and so on. This way if you check their inputs and not what you like, you can send them back to the previous page/form with some error message to correct their choices.</p> <p>You can Use either GET as you are now, or POST</p> <p>You can use one page/file (say forms.php) and use PHP to determine what stage the user is at. Example - say you have user enter number of pictures they want, then ask for their details (may not be what you need but you get the flow idea)</p> <pre><code>//FORM 1 - get number of pictures if ($_GET['whichform'] == '') { echo '&lt;form id="createNewGallery" name="newgallery" method="GET" action="'.$_SERVER['PHP_SELF'].'""&gt;'; echo '&lt;input type="hidden" name="whichform" value="form1" /&gt;'; echo '&lt;input name="submitNumOfPictures" type="submit" /&gt;'; } //FORM 2 - number of pictures submitted so ask for their details elseif ($_GET['whichform'] == 'form1') { echo '&lt;form id="GetUserDetails" name="userdetails" method="GET" action="'.$_SERVER['PHP_SELF'].'""&gt;'; echo '&lt;input type="hidden" name="whichform" value="form2" /&gt;'; echo '&lt;input name="userdetails" type="submit" /&gt;'; } </code></pre> <p>This will let you start with FORM1, once submitted the GET info will return true for if is FORM1, and so it will show FORM 2, and so on for FORM 3, 4, 5, etc It's a crude way in some ways, and needs tweaking (ie testing if the submitted data is as you expect etc) but it gives you the idea on how to manage multiple forms on one page.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload