This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action='newsletter.php' method='post'> | |
<div class="stuff">Email <input type="text" name='email'> | |
<button type="submit" name='submit' >Submit</button> <br></div> | |
<?php if ($result) {echo $result ; } ?> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_POST['email'] != "") | |
{ | |
$email = filter_var($_POST['email'] , FILTER_SANITIZE_EMAIL); | |
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) | |
{ | |
$result = "The mail you entered is not a valid email address."; | |
} | |