Store form inputs on going back a page?

Associate
Joined
4 Mar 2007
Posts
315
Location
United Kingdom
So I have a very large application at about 80% development but there is one feature of the application I haven't been able to implement as I have never done this before.

Upon creating another "parent group" within the application of previously inputted values those values will be displayed in the input fields for the user as a "default" set of inputs.

However for the first time should they press the back button or wish to return is there any way that I could potentially keep the values entered on the previous page to display back to the user. If my description is a bit cruddy here is the idea of "data flow" I wish to pursue.

First Input Page -> Second Input Page -> Final Input Submission

Should the person at the second input page wish to go back and change the first input page. How would I show them the data from the first page?

Should I just submit the data to the database upon submission on the first page and then retrieve it upon page load, if theres nothing returned just keep the value=''

Or is this too much of a security risk?

Regards
 
PHP example for a single page two form submission:

PHP:
if(isset($_POST["correct"]))
{
# Store data to database
# Show thank you message
}
elseif(isset($_POST["submit"]))
{
# Show submitted data on page
# Put data into hidden fields on form
# Show correct and incorrect button options
}
else
{
# Show form with any posted values inserted into text fields, checkboxes ticked and dropdown options selected
# Show submit button
}
 
PHP example for a single page two form submission:

PHP:
if(isset($_POST["correct"]))
{
# Store data to database
# Show thank you message
}
elseif(isset($_POST["submit"]))
{
# Show submitted data on page
# Put data into hidden fields on form
# Show correct and incorrect button options
}
else
{
# Show form with any posted values inserted into text fields, checkboxes ticked and dropdown options selected
# Show submit button
}

Brilliant, overlooked this entirely. Thanks :p
 
Back
Top Bottom