So I am making a little Mail form for practice, anyways.
I want to make a array of emails that cant be emailed to,
$nomail = array("hego556@yahoo.com","firevm@yahoo.com");
if($_POST["to"]!=$nomail)
mail($_POST["to"],$_POST["subject"],$_POST["message"],$headers);
else
echo "Not Allowed To Email That Email";
How do I?
Change the line if($_POST["to"]!=$nomail)
to if (in_array($_POST['to'], $noemail))
$nomail = array('hego556@yahoo.com', 'firevm@yahoo.com');
if (!in_array($_POST['to'], $nomail)) {
mail($_POST["to"],$_POST["subject"],$_POST["message"],$headers);
} else {
echo 'Not Allowed To Email That Email';
}