trying to do validation for email using filter_validate_email. and use meth post. however, I get an error that
Notice: Undefined index: email in H:\XAMPP\htdocs\PHP-Walkthrough-Completed\register.php on line 68
E-mail is not valid
<input type="text" class="form-control" id="email" name="email" required placeholder="Type your email"><span id="emailError"></span>
<?php
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
{
echo("E-mail is not valid");
}
else
{
echo("E-mail is valid");
}
?>
$emailit is obviously not defined anywhere.