function check_spam($value) {
$suspicious = array
(
"content-type:"
,"mime-version:"
,"multipart/mixed"
,"bcc:"
,"cc:"
,"from:"
,"to:"
,"rcpt to:"
,"mail from:"
);
foreach($suspicious as $suspect) {
if(eregi($suspect, strtolower($value))) {
die("Possible Mail Injection");
}
}
} // end function check_spam();
?>
R A D - Kommt wie gerufen!
 |
 |
 |
 |
 |
 |
RADKontakt:
$form=' ';
if (isset($_POST['submit'])) {
$email="klagenfurt@rad.cc";
$msg=$_POST['text'];
$name=$_POST['name'];
$reply=$_POST['email'];
$tel=$_POST['telefon'];
$subject = 'Neue Anfrage von www.rad.cc';
// ------- check spam: -------
if(is_array($_POST)) {
foreach($_POST as $f=>$v) {
$_POST[$f] = check_spam($v);
}
}
// ---------------------------
// format the text:
$text="Neue Anfrage von $name über ihre Website: ";
if ($titel) $text.=" (Zu Objekt \"$titel\") ";
if (trim($tel!="")) $text.=" Telefonnummer: $tel";
if (trim($reply!="")) $text.=" Email- Adresse: $reply";
$text.="
Nachricht: ".nl2br(htmlspecialchars($msg))." ";
// define headers and send mail:
$headers = "From: $email\r\n".
"Reply-to: $reply\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=ISO-8859-1" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
$success=mail($email, $subject, $text, $headers);
if ($success) echo "";
} // end if submit
echo $form;
?>
|
|
|