Having a little trouble validating the email address using FILTER_VALIDATE_EMAIL It's outputting that the email address is in the wrong... FORM <form action="register.php" method="post"> <label>Username</label> <input type="text" name="username"> <label>Email Address</label> <input type="text" name="useremail"> <label>Password</label> <input type="password" name="password"> <label>Repeat Password</label> <input type="password" name="password2"> <input type="submit" class="loginsubmit" value="Register" name="submitb"> </form> HTML: PHP <?php //check if the submit button has been hit if (isset($_POST['submitb'])) { //post variables from form $useremail = $_POST["useremail"]; $username = $_POST["username"]; $password = $_POST["password"]; $password2 = $_POST["password2"]; //check if email is valid format if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailcheck = "email is correct format"; } else { $emailcheck = "email is incorrect format"; } //check if both password fields contain the same password if ($password == $password2) { $passwordcheck = "passwords are the same"; } else { $passwordcheck = "passwords dont match!"; } } ?> <?php include"../includes/head.php";?> <?php echo "$passwordcheck<br />$emailcheck";?> <?php include"../includes/footer.php";?> PHP: