102 lines
3.3 KiB
PHP
102 lines
3.3 KiB
PHP
<h1>Kontakt</h1>
|
|
<img class="rechts" src="img/foto.jpg" alt="Florian Huber" style="margin-left:0px;">
|
|
<h2>Florian Huber</h2>
|
|
<p>Weststraße 21<br>
|
|
87561 Oberstdorf<br></p>
|
|
<table>
|
|
<colgroup>
|
|
<col width="50px" align="left">
|
|
<col width="200px" align="left">
|
|
</colgroup>
|
|
<tr>
|
|
<td>Tel:</td>
|
|
<td>+49 8322 9408148</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Mobil:</td>
|
|
<td>+49 173 3219100</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p> </p>
|
|
<p>E-Mail an diesen Kontakt senden</p>
|
|
<?php
|
|
|
|
error_reporting(0);
|
|
|
|
// *** Deine Mailadresse (Empfänger) ***
|
|
$mail_to="kontakt@huber-sv.de";
|
|
// *************************************
|
|
|
|
$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 den Namen angeben!<br>";
|
|
if(trim($from_mail)=="")
|
|
$err_text.="Bitte die E-Mail-Adresse angeben!<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 eine gültige E-Mail-Adresse angeben.<br>";
|
|
if(trim($mail_subject)=="") $err_text.="Bitte einen Betreff eingeben.<br>";
|
|
if(trim($mail_text)=="") $err_text.="Bitte einen Nachrichtentext eingeben.<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 "index.php?section=kontakt"; ?>" method="post" style="float:left;display:inline;">
|
|
Name:<br>
|
|
<input type="text" name="fromname" size=50 maxlength=120 value="<?php echo $from_name; ?>"><br>
|
|
E-Mail Adresse:<br>
|
|
<input type="text" name="frommail" size=50 maxlength=120 value="<?php echo $from_mail; ?>"><br>
|
|
Betreff:<br>
|
|
<input type="text" name="mailsubject" size=50 maxlength=120 value="<?php echo $mail_subject; ?>"><br>
|
|
Text: <i>(max. 1000 Zeichen)</i><br>
|
|
<td width=100%><textarea cols="38" rows="10" name="mailtext"><?php echo $mail_text; ?></textarea></td></tr>
|
|
<input type="hidden" value="1" name="s"><br>
|
|
<input type="submit" value="Nachricht senden" name="submit">
|
|
</td></tr>
|
|
</table>
|
|
</form>
|
|
|
|
<?php
|
|
} else {
|
|
$header="From: $from_name <$from_mail>\n";
|
|
$header.="Reply-To: $from_mail\n";
|
|
$header.="Mailer: PHP-FormMailer (www.huber-sv.de)\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>Die E-Mail wurde abgesendet.</b></p>";
|
|
echo "<p><a href=\"index.php?section=kontakt&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>";
|
|
}
|
|
}
|
|
?>
|
|
|
|
|