I've got a form handler that emails form input to various people - I thought i'd managed to prevent empty fields from being submitted by using the following condition:
But we're still getting blank input coming through... any ideas?
Code:
// check for required fields
if (trim($_POST['firstName']) != "" && trim($_POST['lastName']) != "" && trim($_POST['homePhone']) != "")
{
// email the form
}
else
{
// inform the user required fields are missing and send them back to the form
}
But we're still getting blank input coming through... any ideas?