PHP Form Validation

This is the first part of PHP Form validation tutorial. Second part is about validating email addresses with PHP.

The validation of data that has been entered in a form is necessary in most cases. Why is important? For example, what good is holding a contest or sweepstakes if you can’t notify the winner, because he or she entered an invalid telephone number or an incorrect address. What good is having a mailing list if the e-mail addresses on it aren’t verified, and your mailing list just bounces back to you without reaching the subscribers and target audience.

Validating form entries saves you time and more importantly, it can save you money. And since somebody embossed the slogan “Time is money!”, this should be very important for your web site!

Well when should we validate? There are two types of validation; client side and server side.

PHP Form Validation – Part II

This tutorial is a second part of PHP Form Validation tutorial I wrote some time ago. In this part I want to show you how to do email address validation using PHP programming language. PHP is running on a server-side, and this means all validation will be caried out on the web server without dependency on user client-side (web browser, javascript support etc.). It is a good security practice to double the efforts and validate an email on the client side as well. But this time its all about PHP.