Server-side validation and form action

Posted by phenry on Stack Overflow See other posts from Stack Overflow or by phenry
Published on 2010-12-23T15:48:29Z Indexed on 2010/12/23 15:54 UTC
Read the original article Hit count: 254

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about html