I keep getting invalid email. Please help! I am new to forms. I have a form in html action is send info to this php. ot sure what the problem is but does it matter if there is two email validation? I have this php page and a jQuery, both validating the email. not sure if that is the affecting this.
<?php
$errors = '';
$myemail = 'something@something.com';
if(empty($_POST['contact_name']) ||
empty($_POST['contact_email']) ||
empty($_POST['contactcomment']))
{
$errors .= "
Error: all fields are required";
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
if(filter_var($email_address,FILTER_VALIDATE_EMAIL) === false)
{
echo 'Email is not valid';
}
else
{
}