PHP Form Validation
Learn how to use PHP to validate HTML forms.
StartKey Concepts
Review core concepts you need to learn to master this subject
Character Sets in Regular Expressions
Optional Quantifiers in Regular Expressions
Literals in Regular Expressions
Fixed Quantifiers in Regular Expressions
Alternation in Regular Expressions
Anchors in Regular Expressions
Regular Expressions
Wildcards in Regular expressions
Character Sets in Regular Expressions
Character Sets in Regular Expressions
Regular expression character sets denoted by a pair of brackets []
will match any of the characters included within the brackets. For example, the regular expression con[sc]en[sc]us
will match any of the spellings consensus
, concensus
, consencus
, and concencus
.
- 1Modern websites require a lot of information to function as intended. Information like our usernames, passwords, “friends”, “likes”, credit card information, and shopping orders all have to be prov…
- 2Most data, once submitted, is stored by a website or web application. It’s stored in a database on the server side. There are important reasons for us to make sure the information that will be stor…
- 3Data submitted through forms are stored as strings. Strings are a fundamental data type in computer science representing a series of characters “strung” together. As humans, we can intuitively reco…
- 4The first technique we can use to validate form data is to prevent problematic inputs from being submitted in the first place. This is called client-side validation. The client is the process int…
- 5Client-side validation has two main advantages. First, it’s a better experience for the user to be alerted to problematic data immediately rather than having to wait for that information to come ba…
- 6No matter how complete the front-end validation of a website or application seems, validations must also be completed on the back-end or server-side. Front-end validations are easy to bypass—a mali…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory