Validating form with php
In this document we have discussed Java Script Form Validation using a sample registration form.
As server side form validation is done on server, the submitted data is validated and cleaned by server and then it is used.
Client side form validation is done in user’s machine but server side form validation is done on server.
We cannot relay on data that are only validated in client side because a expert level user may change those data before submission to the server.
No one can modify those data without having access to the server.
In this example, you will need two files as below with correspondence names. These files are commented enough to understand what’s going on. If you want, you can use get method, just change method=”get” and replace $_POST with $_GET – that’s all.Following pictorial shows in which field, what validation we want to impose.