We have also added an if else statement for each $_POST variable.
This checks if the $_POST variable is empty (with the PHP empty() function).
Client side validation is performed by a web browser, before input is sent to a web server.
A text field is a basic text control that enables the user to type a small amount of text.
As a multi-paradigm language, Java Script supports event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles.
It has an API for working with text, arrays, dates, regular expressions, and basic manipulation of the DOM, but does not include any I/O, such as networking, storage, or graphics facilities, relying for these upon the host environment in which it is embedded.
It is used to make webpages interactive and provide online programs, including video games.
If it is empty, an error message is stored in the different error variables, and if it is not empty, it sends the user input data through the test_input() function: Then in the HTML form, we add a little script after each required field, which generates the correct error message if needed (that is if the user tries to submit the form without filling out the required fields): The next step is to validate the input data, that is "Does the Name field contain only letters and whitespace?