In the previous chapter, we learned about databases. This got us most of the way to building our registration and login forms. One topic we didn’t spend enough time on was how to respond in the absence or poor formatting of data.
In this chapter, we’re going to start validating our forms. We’ll learn how to make fields required, how to enforce the format of the data we do get, and how to display validation errors to the user. We’ll also look at how to customize error pages for all the common types of errors users are bound to see.