';
}
}
else
{
$quantity = NULL;
echo 'Please enter quantity ';
}
if (!empty($_POST['email']))
{
$email = $_POST['email'];
// // check if the data entry is in an expected pattern
// $pattern = '/\b[\w.-]+@[\w.-]+\.[A-Za-z]{2,6}\b/';
// if (!preg_match($pattern, $email))
// {
// $email = NULL;
// echo 'Email address is incorrect format ';
// }
// An alternative solution is to set type="email" in an tag
// and have the form submit to itself
}
else
{
$quantity = NULL;
echo 'Please enter an email address ';
}
if (($quantity != NULL) && ($email != NULL))
echo "Email: $email Quantity: $quantity ";
?>