Ich bins nochmal!
Ich hab mir soweit alles durchgelesen und meinen Quelltext dementsprechend (hoffe ich zumindest) abgeändert.
PHP-Code:
if(isset($_POST['senden'])) {
$anreise = ''.$tagan.'.'.$monatan.'.'.$jahran.'';
$abreise = ''.$tagab.'.'.$monatab.'.'.$jahrab.'';
$ip = $REMOTE_ADDR;
$host = gethostbyaddr($ip);
$referrer = $HTTP_REFERER;
$korrekt=true;
if(isset($anrede)) {$anrede = $_POST['anrede'];}
if(isset($vorname)) {$vorname = $_POST['vorname'];}
if(isset($nachname)) {$nachname = $_POST['nachname'];}
if(isset($straße)) {$straße = $_POST['straße'];}
if(isset($hausnr)) {$hausnr = $_POST['hausnr'];}
if(isset($plz)) {$plz = $_POST['plz'];}
if(isset($ort)) {$ort = $_POST['ort'];}
if(isset($vorwahl)) {$vorwahl = $_POST['vorwahl'];}
if(isset($telnr)) {$telnr = $_POST['telnr'];}
if(isset($email)) {$email = $_POST['email'];}
if(isset($sonstiges)){$sonstiges = $_POST['sonstiges'];}
if(isset($personen)) {$personen = $_POST['personen'];}
if(isset($kinder)) {$kinder = $_POST['kinder'];}
if(isset($tagan)) {$tagan = $_POST['tagan'];}
if(isset($monatan)) {$monatan = $_POST['monatan'];}
if(isset($jahran)) {$jahran = $_POST['jahran'];}
if(isset($tagab)) {$tagab = $_POST['tagab'];}
if(isset($monatab)) {$monatab = $_POST['monatab'];}
if(isset($jahrab)) {$jahrab = $_POST['jahrab'];}
if(isset($captcha)) {$captcha = $_POST['captcha'];}
session_start();
if ($anrede==''){
$fehl[0]=true;
$korrekt=false;}
if (!preg_match("/^([a-zäöüß\-\ ]{3,30})+$/i",$vorname)){
$fehl[1]=true;
$korrekt=false;}
if (!preg_match("/^([a-zäöüß\-\ ]{3,30})+$/i",$nachname)){
$fehl[2]=true;
$korrekt=false;}
if (!preg_match("/^([a-z0-9äöüß\-\.\ ]{5,40})+$/i",$straße)){
$fehl[3]=true;
$korrekt=false;}
if (!preg_match("/^([0-9]{1,3}+[a-d]{0,1})+$/i",$hausnr)){
$fehl[4]=true;
$korrekt=false;}
if (!preg_match("/^([0-9]{4,5})+$/i",$plz)){
$fehl[5]=true;
$korrekt=false;}
if (!preg_match("/^([a-zäöüß\-\.\ ]{3,40})+$/i",$ort)){
$fehl[6]=true;
$korrekt=false;}
if (!preg_match("/^([0-9]{2,5})+$/i",$vorwahl)){
$fehl[7]=true;
$korrekt=false;}
if (!preg_match("/^([0-9\-\/]{4,10})+$/i",$telnr)){
$fehl[8]=true;
$korrekt=false;}
if (strlen($land)>0){
$fehl[9]=true;
$korrekt=false;}
if($email==''){
$korrekt=true;}
else{
if(!preg_match("/^[0-9a-z\-\_\.]+@([0-9a-z][0-9a-z\-]+\.)+[a-z]{2,3}+$/i",$email)){
$fehl[10]=true;
$korrekt=false;}}
if($email==''){$email=='keine Angabe';}
if (strlen($sonstiges)>100){
$fehl[11]=true;
$korrekt=false;}
if ($personen==''){
$fehl[12]=true;
$korrekt=false;}
if ($kinder==''){
$fehl[13]=true;
$korrekt=false;}
if ($tagan==''){
$fehl[14]=true;
$korrekt=false;}
if ($monatan==''){
$fehl[15]=true;
$korrekt=false;}
if ($jahran==''){
$fehl[16]=true;
$korrekt=false;}
if ($tagab==''){
$fehl[17]=true;
$korrekt=false;}
if ($monatab==''){
$fehl[18]=true;
$korrekt=false;}
if ($jahrab==''){
$fehl[19]=true;
$korrekt=false;}
if ($anreise > $abreise){
$fehl[20]=true;
$korrekt=false;}
if ($tagan+3 > $tagab){
$fehl[21]=true;
$korrekt=false;}
if(isset($_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);}
else{
$fehl[22]=true;
$korrekt=false;}
if($korrekt){
$empfaenger="name@domain.de";
$subject="Buchung vom ".date("d.m.Y")."\r\n";
$mailheader="From: Buchungsformular\r\n";
$mailheader="X-Mailer: PHP/" . phpversion(). "\r\n";
$mailheader="Content-Type: text/html; charset=UTF-8\r\n";
$text=nl2br("
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>
<body>
<font style='font-family: Verdana; font-size: 12px; color: #555555; line-height: 15px;'>
Soeben ist eine neue Buchung von $anrede $nachname eingegangen!
Es folgen die eingegebenen Daten:
</font>
<h2 style='font-size: 14px; font-weight: bold; color: #ff9000'>Persönliche Daten</h2>
<font style='font-family: Verdana; font-size: 12px; color: #555555; line-height: 15px;'>
Anrede: $anrede
Vorname: $vorname
Nachname: $nachname
Straße, Nr.: $straße $hausnr
PLZ, Ort: $plz $ort
Telefon: $vorwahl/$telnr
eMail: $email
Sonstiges: $sonstiges
</font>
<h2 style='font-size: 14px; font-weight: bold; color: #ff9000'>Daten zum Aufenthalt</h2>
<font style='font-family: Verdana; font-size: 12px; color: #555555; line-height: 15px;'>
Personen: $personen
Kinder: $kinder
Anreise: $anreise
Abreise: $abreise
</font>
<h2 style='font-size: 14px; font-weight: bold; color: #ff9000'>Zusätzliche Daten (unwichtig für die Buchung)</h2>
<font style='font-family: Verdana; font-size: 12px; color: #555555; line-height: 15px;'>
Captcha-Code: $captcha_spam
IP-Adresse: $ip
Hostname: $host
Referrer: $referrer
</font>
</body>
</html>");
if (@mail($empfaenger, $subject, $text, $mailheader)) {
header("Location:kontakttest5.php?checked");
exit;}
Die Punkte und Anführungszeichen bei ...
Zitat:
$anreise = ''.$tagan.'.'.$monatan.'.'.$jahran.'';
$abreise = ''.$tagab.'.'.$monatab.'.'.$jahrab.'';
|
... habe ich gelassen, da sie das Datum quasi "trennen" sollen (Tag.Monat.Jahr)! Lasse ich die Anführungszeichen (') weg, wird das Datum so angezeigt: TagMonatJahr .
Ich hoffe mein Quelltext stimmt jetzt soweit!
PS.: Ich habe das eigentliche Problem mit Inline CSS gelöst! Danke an alle, die mir geholfen haben!
Gruß,
moercel