Server-side validation and form action
- by phenry
I have a page (call it form.php) with a form for users to fill out. When the form is submitted, I want to validate it with a server-side script (call it validate.php if necessary, although the code could also go in one of the other pages if that would be better). If any part of the form fails validation, I want to kick back to form.php with the fields the user needs to fix highlighted. If the form passes validation, I want to go to another page, success.php.
Which page should I put in the "action" attribute of the <form> element, and what's the best way to get from that page to one of the others?