I have some HTML forms that I want to validate using PHP. I've been told that I should validate them by posting them to a separate PHP file, rather than including the PHP code in the HTML document (as someone could save the source, amend the PHP validation to be able to input anything).
Any pointers on validating the following would be great:
- A form to just have letters and numbers
- A date form to be the correct format (dd/mm/yyyy)
- A form not to be blank
If this is correct, then proceed to add these to the database.
However, with having validation outside of the HTML itself, how do I give an error message highlighting which form had data in an incorrect form?
Any pointers on validating the following would be great:
- A form to just have letters and numbers
- A date form to be the correct format (dd/mm/yyyy)
- A form not to be blank
If this is correct, then proceed to add these to the database.
However, with having validation outside of the HTML itself, how do I give an error message highlighting which form had data in an incorrect form?