Php code for validating a form

We used “@” in case if the variable is not set, it won’t show any error.

In the at very beginning, we initialized variable name $error as blank.

What I need feedback on is if I've forgotten anything in terms of accessibility, security (am I open to any SQL injections or other risks? It's my first time creating a proper registration form like this so surely there must be things to improve.

Bad data can harm a server, steal information or even can delete a whole database.

As server side form validation is done on server, the submitted data is validated and cleaned by server and then it is used.

In this post, you’ll learn – How to Validate Forms with PHP and it will be a server side form validation.

We will create a user registration form at first, and then we will validate fields of that form such as name, email, phone number, birth date, bio etc.


Leave a Reply