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

Genius (TV Series 2017– ) – IMDb

Created by Kenneth Biller, Noah Pink. With Michael McElhatton, Johnny Flynn, Samantha Colley, Ralph Brown. The life story of Albert Einstein, one of history’s greatest minds. From his days as a young adult to his final years we see his discoveries, his loves, his relationships, his causes, his flaws and his genius.

Source: Genius (TV Series 2017– ) – IMDb

Genius (TV Series 2017– ) – IMDb was last modified: October 17th, 2017 by Jovan Stosic

Mission Control: The Unsung Heroes of Apollo (2017) – IMDb

Directed by David Fairhead. With James Burke, Gerry Griffin, Chris Kraft, Gene Kranz. At the heart of the Apollo program was the special team in Mission Control who put a man on the moon and helped create the future.

Source: Mission Control: The Unsung Heroes of Apollo (2017) – IMDb

Mission Control: The Unsung Heroes of Apollo (2017) – IMDb was last modified: October 17th, 2017 by Jovan Stosic