";
$class = $bad_class;
$good = 0;
}
if (!$_POST['email']) {
$output .= "E-mail has not been given
";
$class = $bad_class;
$good = 0;
}
if (!$_POST['problem']) {
$output .= "No problem has been specified";
$class = $bad_class;
$good = 0;
}
// If it's all set //
if ($good == 1) {
// Remove BCC,CC, and ACC //
$_POST['username'] = preg_replace('/(a|b)?cc:\s*/i','',$_POST['username']);
$_POST['email'] = preg_replace('/(a|b)?cc:\s*/i','',$_POST['email']);
$site = preg_replace('/(a|b)?cc:\s*/i','',$site);
$_POST['problem'] = preg_replace('/(a|b)?cc:\s*/i','',$_POST['problem']);
$headers = "";
$headers .= "From: {$_POST['email']}\n";
$headers .= "Reply-To: {$_POST['email']}\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$body = "
Username: {$_POST['username']} \n
E-mail: {$_POST['email']} \n
Site in question: {$site} \n
Problem: \n
{$_POST['problem']} \n
";
if (mail($receiving_email, "Support for {$site}", $body, $headers)) {
$output = "Your problem has been registered. We will attend to it as soon as possible";
$class = $good_class;
}
else {
$output = "Your problem could not be registered. Please try again in a few minutes.";
$class = $bad_class;
}
}
}
?>