Welcome to WebmasterWorld Guest from 126.96.36.199
I have a form that submits to a php script to process the output but am having difficulty with the validation piece.
The form works fine, submits to my processing page that stores the form field values in variables and then submits an email. I am stuck with how to check for any empty field values (going through them all first) and then redirect back to the original form, repopulating the form with the values that were entererd and indicating to the user (message) the fields that were not filled out.
I know I can use session variables to store the form data but my mind keeps spinning in circles (like my code these days) on how to let the script know to go back and forth.
Any help would be greatly appreciated.
-- If a value, store in a session variable for re-use (to repopulate the field if directed back to the form because of an empty value somewhere else) or
-- If no value, set a message value for that field and store it in a session variable to be passed back to the form for displaying to the user.
Ideally I would like to "test" all field values and generate variables for all fields before going back to tell the user, or in the case of success just executeg my script after the validation.