It used to be the case that most form validations were done using javascript. However, it's been a while since I last saw a site using this method. Instead, everyone seems to be using server side validation techniques. Which is better? Client-side javascript, server-side scripting or both?
A combination of both is best. a) it prevents the round-trip to the server, because the validation can happen before the form is submitted b) if anything gets past the javascript, the PHP can do further validation, and even MX lookups on email addresses
I use that code myself on the feedback part of my website (see sig) I use only PHP because I don't want to bother with JS, lol.