Category: PHP5
Added: 15th of December 2015
Viewed: 1108 times
It is important to validate user input with all your forms in .php. It will ensure that your data remains consistent.
The following .php code displays a simple contact form, but also displays an error message on the same page if the user fails to complete any of the form fields.
There are other ways to validate forms using HTML5, or Javascript, it's all down to personal preference.
Open up your text editor, copy and paste the code below and save the file as form.php then upload it to your local or remote server to test the script.
Other Tips & Tutorials
PHP5
Get the day of the week for a specified date using PHP5Posted: 17th of January 2016
Views: 1864
PHP5
Count the number of elements in a PHP array using the count() functionPosted: 15th of December 2015
Views: 970
PHP5
Pass ampersand through query strings in URL using PHP5Posted: 27th of November 2015
Views: 2281