Validating a web form in php

6854933580_2c8b688306_z

That's when you refresh the page after submitting the form , POST values still remains and possible for duplicating entries. If a form needs to be validated before being submitted - say, to a database for querying or insertion - javascript should be used, because an additional php action/direction is ineffecient/incorrect/superfluous?

validating a web form in php-76validating a web form in php-12validating a web form in php-28

Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).Required field will check whether the field is filled or not in the proper way.Most of cases we will use the * symbol for required field.In this tutorial, we will see how to use PHP to validate the data collected from a form.You will see how to validate various fields used in general, like text, list, checkbox, radio button and we will also see how to retain POST data, so that after the user submits the form, even if the data supplied is not valid, data is not lost.Validation means check the input submitted by the user.

You must have an account to comment. Please register or login here!