Hi all,
I have an issue for getting the form data to enable the user to preview and check on the summary of the submitted data.
If they confirmed the the submitted data is in correct order, then they are able to confirm the submission.
Else they can return to the previous page and edit the data, where the entered data are all in the various input textbox, checkbox, drop down selection, etc.
How will it be possible for me to work on the coding to get to that point? I heard from other forums that this can be done by setting session, but have no idea how it really can be done.
Thank you very much.
Need help on PHP Form Submission
Started by missionaire, Mar 08 2007 11:44 PM
1 reply to this topic
#1
Posted 08 March 2007 - 11:44 PM
#2
Posted 09 March 2007 - 04:17 PM
How are you dealing with the data?
If you are entering it into a database, you can simply have a column named 'confirmed', and set it to false when first inserted. Then the user can confirm it, and the form sends a different request to the script that tell is to update that column to true.
If you are using it to email data, or anything else, I would use something like this, as its simple enough.
1. Original form shown.
2. User adds information, submits data.
3. Script takes data, puts it into the format you want, asks for confirmation. At this step, the script also throws the data into an invisible form, setting the values of the hidden inputs. Also, the submit button for that hidden form, just happens to be the confirm button the user needs to press.
4. User clicks 'Confirm', hidden form sends data to script that does whatever it is you need to do with it.
Of course the database method makes more sense, and would be ideal. Also, you could indeed use sessions, simply having the form set the session variables to those of the submitted form, where any other script can access it just as easily. Read up on simple session tutorials for information on how to do that if you need.
If you are entering it into a database, you can simply have a column named 'confirmed', and set it to false when first inserted. Then the user can confirm it, and the form sends a different request to the script that tell is to update that column to true.
If you are using it to email data, or anything else, I would use something like this, as its simple enough.
1. Original form shown.
2. User adds information, submits data.
3. Script takes data, puts it into the format you want, asks for confirmation. At this step, the script also throws the data into an invisible form, setting the values of the hidden inputs. Also, the submit button for that hidden form, just happens to be the confirm button the user needs to press.
4. User clicks 'Confirm', hidden form sends data to script that does whatever it is you need to do with it.
Of course the database method makes more sense, and would be ideal. Also, you could indeed use sessions, simply having the form set the session variables to those of the submitted form, where any other script can access it just as easily. Read up on simple session tutorials for information on how to do that if you need.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
