Question about submitting forms
Posted: Sun Jun 01, 2008 12:10 pm
Hello, I'm new to the forum and to php.
I have questions regarding submitting forms. My test form has 3 input fields: name, email and zipcode.
Is it best-practice to submit the form to the same page? Or to submit it to a different page and then redirect back to the first page to show an error or success message via session vars?
I'm assuming the perk to submitting to the same page is to avoid the need to use cookies/sessions to save field values to repopulate the fields text values when there is an error? Eg: they filled out name and email, but left zipcode blank -they shouldn't have to re-enter their name and email.
I have questions regarding submitting forms. My test form has 3 input fields: name, email and zipcode.
Is it best-practice to submit the form to the same page? Or to submit it to a different page and then redirect back to the first page to show an error or success message via session vars?
I'm assuming the perk to submitting to the same page is to avoid the need to use cookies/sessions to save field values to repopulate the fields text values when there is an error? Eg: they filled out name and email, but left zipcode blank -they shouldn't have to re-enter their name and email.