I'm having a problem with my php code.
I don't want the else echo "Check it again!";
to show unless they input some data into the form(input box) and it's not valid. But when I load the page it shows the error above the box.
<?PHP
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
mysql_query("INSERT INTO newsletter (email) VALUES('$email')") or die(mysql_error());
echo 'You have registered your E-Mail address to our database! You will now receive regular updates on the progess!';
}else{
echo "Check it again!";
}
?>
<form name="newsletter" method="post" action="<?PHP $_SERVER['PHP_SELF']?>">
<input type="text" name="newsletter" id="newsletter">
<input type="submit" value="SUBMIT!">
</form>