Form Validation using PHP
Filed Under (Forms, Web Design) by Dave on 17-05-2008
Tagged Under : form validation, html & php E-mail form, PHP email script
On an earlier tutorial I wrote about how to create and send an email form using html and a basic php script. Today I’ll take it up a level and re-write that script using the if, else conditional and empty() function to include form validation.
Using an if, else conditional: if (condition) {do something} else { do this} , we can make certain fields of our form required that they be filled out. Let’s start by making a basic form with first name, last name, email and comments as our text inputs. Copy the following code into a text document then save and name it form.html:



