Skip to content

Instantly share code, notes, and snippets.

View agustinferreira's full-sized avatar

Agustin Ferreira agustinferreira

View GitHub Profile
<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>
<?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.";
}