<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Kontaktformular -- www.gaijin.at</title>
<meta name="title" content="Kontaktformular -- www.gaijin.at">
<meta name="description" content="Kontaktformular von www.gaijin.at">
<meta name="keywords" content="Kontakt, Kontaktformular">
<meta name="author" content="Gaijin">
<meta http-equiv="content-language" content="de-at">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Kontakt</h1><br>
<?php
// *** Deine Mailadresse (Empfänger) ***
$mail_to="deine@mailadresse.com";
// *************************************
$from_name=$_POST['fromname'];
$from_mail=strtolower($_POST['frommail']);
$mail_subject=$_POST['mailsubject'];
$mail_text=$_POST['mailtext'];
$send=$_POST['s'];
if(trim($from_name)=="") $err_text.="Bitte gib Deinen Namen an.<br>";
if(trim($from_mail)=="")
$err_text.="Bitte gib Deine E-Mail-Adresse an.<br>";
else
if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$",$from_mail))
$err_text.="Bitte gib eine gültige E-Mail-Adresse an.<br>";
if(trim($mail_subject)=="") $err_text.="Bitte gib einen Betreff ein.<br>";
if(trim($mail_text)=="") $err_text.="Bitte gib einen Nachrichtentext ein.<br>";
// *** Zu langen Text abschneiden ***
if(strlen($mail_text)>1000) {
$mail_text=substr($mail_text,0,1000)."... (Text wurde gekürzt!)";
}
$from_name=str_replace(chr(34),"''",$from_name);
$mail_subject=str_replace(chr(34),"''",$mail_subject);
$from_name=stripslashes($from_name);
$from_mail=stripslashes($from_mail);
$mail_subject=stripslashes($mail_subject);
$mail_text=stripslashes($mail_text);
if(($send=="1") && (isset($err_text))) {
echo "<p><big><b>Fehler:</b></big><br>";
echo "$err_text</p>";
}
if(($send!="1") || (isset($err_text)))
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table border=0 cellspacing=2 cellpadding=0 width=100%>
<tr><td nowrap align=right>Dein Name:</td><td> </td>
<td width=100%><input type="text" name="fromname" size=50 maxlength=120 value="<?php echo $from_name; ?>"></td></tr>
<tr><td nowrap align=right>Deine E-Mail Adresse:</td><td></td>
<td width=100%><input type="text" name="frommail" size=50 maxlength=120 value="<?php echo $from_mail; ?>"></td></tr>
<tr><td nowrap align=right>Betreff:</td><td></td>
<td width=100%><input type="text" name="mailsubject" size=50 maxlength=120 value="<?php echo $mail_subject; ?>"></td></tr>
<tr><td nowrap align=right valign=top>Text:<br><i>(max. 1.000 Zeichen)</i></td><td></td>
<td width=100%><textarea cols="40" rows="10" name="mailtext"><?php echo $mail_text; ?></textarea></td></tr>
<tr><td></td><td></td><td>
<input type="hidden" value="1" name="s">
<input type="submit" value="Nachricht versenden" name="submit">
</td></tr>
</table>
</form>
<?php
} else {
$header="From: $from_name <$from_mail>\n";
$header.="Reply-To: $from_mail\n";
$header.="X-Mailer: PHP-FormMailer (www.gaijin.at)\n";
$header.="Content-Type: text/plain";
$mail_date=gmdate("D, d M Y H:i:s")." +0000";
$send=0;
if(@mail($mail_to,$mail_subject,$mail_text,$header))
{
echo "<p><b>Deine E-Mail wurde abgesendet.</b></p>";
echo "<p><a href=\"".$_SERVER['PHP_SELF']."?from_name=$from_name&from_mail=$from_mail\">Zurück zum Formular</a></p>";
}else{
echo "<p><b>Beim Versenden der E-Mail ist ein Fehler aufgetreten!</b></p>";
echo "<p><a href=\"".$_SERVER['PHP_SELF']."?from_name=$from_name&from_mail=$from_mail&mail_subject=$mail_subject&mail_text=";
echo urlencode($mail_text)."\">Zurück zum Formular</a></p>";
}
}
?>
<p><a href="http://www.gaijin.at/">Copyright © 2003-2007 www.gaijin.at</a></p>
</body>
</html>