Click to See Complete Forum and Search --> : banning certain email addresses


s1deus
06-28-2006, 12:22 AM
This is what I have:

#!/usr/local/bin/php
<?php
// handlefeedbacksubmit.php
// takes the submitted form and emails the target email address a formatted version of the data entered into the form.

include_once("emailConfigs.php");

$name = $_POST["Name"];
$email = $_POST["Email"];
$comments = $_POST["Comments"];
$subject = $_POST["Subject"];

if(mail($targetEmail,
$subject,
$name . " says... " . $comments,
'From: ' . $email . "\r\n" . 'X-Mailer: PHP' . phpversion()))
{
echo $successMessage;
}
else
{
echo $failureMessage;
}

?>

How do I write it so that I can ban specific email addresses (more than one)?
Preferably something with a banmessage like $banMessage = "You've been banned for numerous violations.";

Any help would be great.

Thx

themarty
06-28-2006, 11:59 AM
$bannedEmailAddresses = array("bla@di.bla", "me@email.com");
if (in_array($email, $bannedEmailAddresses))
{
echo "too bad";
}
else
{
// proceed to send mail
}