php – How to submit additional variables alongside form submission? – Stack Overflow

I have an HTML form that works properly and stores all variables (‘firstname’, ‘lastname’, etc.) in theGET array.

At the time of form submission, I need to pass an additional variable in the GET array to let the PHP controller know to display the next set of prompts. Something simple like step=2.

What I tried doing was setting the form action to ?step=2 as well as ?step=2&. But, no matter what I try, the form’s variables are all that show up in the URL.

What am I doing wrong? Is this even possible?

shareimprove this question
 

2 Answers

You can use a hidden form field in your form:

<input type="hidden" name="step" value="2">

 

Source: php – How to submit additional variables alongside form submission? – Stack Overflow

php – How to submit additional variables alongside form submission? – Stack Overflow was last modified: November 3rd, 2017 by Jovan Stosic

Leave a Reply