Reloading a form with user input
I am trying to figure out the best way to reload a form with user input when their submit fails. Currently this is how i have it set up. Please give me some feedback.
I created a php form whos action calls submit.php. All fields in this form have a default value according to the session variables. (So when the form is first loaded everything is null) When submit.php is called all variables from the form are stored in session variables. Then i impose a few checks such as: If the two password fields are not the same i display an error and use this statement to reload my form.
include "club_form.php";
So when club_form.php is called again it loads the default values of the form as the session variables.
Is this the best way to save user input if they fail any sort of programmer enforced check during the submission process?
|