With more and more personal information being stored on the Web—credit card data, social security numbers, maiden names, favorite pets—today's PHP developer cannot afford to be ignorant when it comes to security.
Sadly, most beginning programmers fail to understand the truth about security: there is no such thing as "secure" or "insecure." The wise programmer knows that the real question is a site is.
It prevents the form from being resubmitted if the landing page is reloaded, and allows us to display validation error messages inline using PHP.
Finally, the code includes PHP commands to re-insert any submitted values back in to the form so they don't have to be retyped in case of an error.
You'll notice that we've used PHP to insert the form as the current page.