So I've got this contact form that goes something like this (abbreviated version):
if ($submit) {
if ($Name && $Email && $Subject && $Message) {
# go ahead and email message to me
} else {
echo "Hey you forgot some fields, chump!\n";
}
}
# form goes here
Okay, so it's a REALLY abbreviated version. :p Point is, I'm requiring that they fill out the "Name", "Email", "Subject", and "Message" fields and if they don't they get the warning message. It all works well enough, except it also works if they put spaces in the fields, instead of actual text. Any way to easily validate that something other than the spacebar was used when inputing data in a form field?