- Registriert
- 20.12.07
- Beiträge
- 26
Hallo Zusammen,
hab ein Problem mit einem Formular und bekomme immer wieder folgende Fehlermeldung:
$error = false; $errors = array(); $receiver = '[email protected]'; function check_email ($string) { // RegEx created by Myle Ott, found at regexlib.com return preg_match('/^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([a-zA-Z0-9])+(([\-])+([a-zA-Z0-9])+)*\.)+([a-zA-Z])+(([\-])+([a-zA-Z0-9])+)*))$/i', $string); } function check_onlynumbers ($string) { return preg_match('/^[0-9,.]{1,}$/', $string); } function check_onlyletters ($string) { return preg_match('/^[a-zA-ZäöüÄÖÜß]{1,}$/', $string); } function send_email ($subject, $body, $receiver, $html = 1) { if ($html != 1) { $body = str_replace('
', "\n", $body); $body = str_replace('
', "\n", $body); $body = strip_tags($body); } $subject = str_replace('\n', '', $subject); $subject = str_replace('\r', '', $subject); if ($html) { $header = 'MIME-Version: 1.0' . "\n"; $header .= 'Content-type: text/html; charset=iso-8859-15'."\n"; $header .= 'From: '.$receiver.' <'.$receiver.'>'."\n"; } else { $header = 'MIME-Version: 1.0' . "\n"; $header .= 'From: '.$receiver.' <'.$receiver.'>'."\n"; } if (mail($receiver, $subject, $body, $header)) { return true; } else { return false; } } function array_stripslashes(&$var) { if(is_string($var)) { $var = stripslashes($var); } else { if(is_array($var)) foreach($var as $key => $value) array_stripslashes($var[$key]); } } if(get_magic_quotes_gpc()){ array_stripslashes($_GET); array_stripslashes($_POST); array_stripslashes($_REQUEST); array_stripslashes($_COOKIE); } if (!empty($_POST)) { // Prüfung für das Feld "Ihr Vorname" $errors['Vorname'] = null; if (empty($_POST['Vorname'])) { $error = true; $errors['Vorname'] = ' class="error"'; } // Prüfung für das Feld "Ihr Nachname" $errors['Nachname'] = null; if (empty($_POST['Nachname'])) { $error = true; $errors['Nachname'] = ' class="error"'; } // Prüfung für das Feld "Ihre Straße" $errors['Strasse'] = null; if (empty($_POST['Strasse'])) { $error = true; $errors['Strasse'] = ' class="error"'; } // Prüfung für das Feld "Ihre PLZ" $errors['PLZ'] = null; if (empty($_POST['PLZ'])) { $error = true; $errors['PLZ'] = ' class="error"'; } if (!check_onlynumbers($_POST['PLZ'])) { $error = true; $errors['PLZ'] = ' class="error"'; } // Prüfung für das Feld "Ihr Ort" $errors['Ort'] = null; if (empty($_POST['Ort'])) { $error = true; $errors['Ort'] = ' class="error"'; } // Prüfung für das Feld "Ihr Land" $errors['Land'] = null; if (empty($_POST['Land'])) { $error = true; $errors['Land'] = ' class="error"'; } // Prüfung für das Feld "Ihr Telefon" $errors['Telefon'] = null; if (!check_onlynumbers($_POST['Telefon'])) { $error = true; $errors['Telefon'] = ' class="error"'; } // Prüfung für das Feld "Ihr MobilT" $errors['MobilT'] = null; if (!check_onlynumbers($_POST['MobilT'])) { $error = true; $errors['MobilT'] = ' class="error"'; } // Prüfung für das Feld "Ihr Reisetermin" $errors['Reisetermin'] = null; if (empty($_POST['Reisetermin'])) { $error = true; $errors['Reisetermin'] = ' class="error"'; } // Prüfung für das Feld "Anzahl der Reisenden" $errors['Reisende'] = null; if (empty($_POST['Reisende'])) { $error = true; $errors['Reisende'] = ' class="error"'; } } $_text_Vorname = (!empty($_POST['Vorname']) ? htmlspecialchars($_POST['Vorname'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Nachname = (!empty($_POST['Nachname']) ? htmlspecialchars($_POST['Nachname'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Strasse = (!empty($_POST['Strasse']) ? htmlspecialchars($_POST['Strasse'], ENT_QUOTES, 'iso-8859-15') : null); $_text_PLZ = (!empty($_POST['PLZ']) ? htmlspecialchars($_POST['PLZ'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Ort = (!empty($_POST['Ort']) ? htmlspecialchars($_POST['Ort'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Land = (!empty($_POST['Land']) ? htmlspecialchars($_POST['Land'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Telefon = (!empty($_POST['Telefon']) ? htmlspecialchars($_POST['Telefon'], ENT_QUOTES, 'iso-8859-15') : null); $_text_MobilT = (!empty($_POST['MobilT']) ? htmlspecialchars($_POST['MobilT'], ENT_QUOTES, 'iso-8859-15') : null); $_textarea_Sonstiges = (!empty($_POST['Sonstiges']) ? htmlspecialchars($_POST['Sonstiges'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Reisetermin = (!empty($_POST['Reisetermin']) ? htmlspecialchars($_POST['Reisetermin'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Reisende = (!empty($_POST['Reisende']) ? htmlspecialchars($_POST['Reisende'], ENT_QUOTES, 'iso-8859-15') : null); $_textarea_Fragen = (!empty($_POST['Fragen']) ? htmlspecialchars($_POST['Fragen'], ENT_QUOTES, 'iso-8859-15') : null);
Danke für euer Hilfe!
hab ein Problem mit einem Formular und bekomme immer wieder folgende Fehlermeldung:
$error = false; $errors = array(); $receiver = '[email protected]'; function check_email ($string) { // RegEx created by Myle Ott, found at regexlib.com return preg_match('/^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([a-zA-Z0-9])+(([\-])+([a-zA-Z0-9])+)*\.)+([a-zA-Z])+(([\-])+([a-zA-Z0-9])+)*))$/i', $string); } function check_onlynumbers ($string) { return preg_match('/^[0-9,.]{1,}$/', $string); } function check_onlyletters ($string) { return preg_match('/^[a-zA-ZäöüÄÖÜß]{1,}$/', $string); } function send_email ($subject, $body, $receiver, $html = 1) { if ($html != 1) { $body = str_replace('
', "\n", $body); $body = str_replace('
', "\n", $body); $body = strip_tags($body); } $subject = str_replace('\n', '', $subject); $subject = str_replace('\r', '', $subject); if ($html) { $header = 'MIME-Version: 1.0' . "\n"; $header .= 'Content-type: text/html; charset=iso-8859-15'."\n"; $header .= 'From: '.$receiver.' <'.$receiver.'>'."\n"; } else { $header = 'MIME-Version: 1.0' . "\n"; $header .= 'From: '.$receiver.' <'.$receiver.'>'."\n"; } if (mail($receiver, $subject, $body, $header)) { return true; } else { return false; } } function array_stripslashes(&$var) { if(is_string($var)) { $var = stripslashes($var); } else { if(is_array($var)) foreach($var as $key => $value) array_stripslashes($var[$key]); } } if(get_magic_quotes_gpc()){ array_stripslashes($_GET); array_stripslashes($_POST); array_stripslashes($_REQUEST); array_stripslashes($_COOKIE); } if (!empty($_POST)) { // Prüfung für das Feld "Ihr Vorname" $errors['Vorname'] = null; if (empty($_POST['Vorname'])) { $error = true; $errors['Vorname'] = ' class="error"'; } // Prüfung für das Feld "Ihr Nachname" $errors['Nachname'] = null; if (empty($_POST['Nachname'])) { $error = true; $errors['Nachname'] = ' class="error"'; } // Prüfung für das Feld "Ihre Straße" $errors['Strasse'] = null; if (empty($_POST['Strasse'])) { $error = true; $errors['Strasse'] = ' class="error"'; } // Prüfung für das Feld "Ihre PLZ" $errors['PLZ'] = null; if (empty($_POST['PLZ'])) { $error = true; $errors['PLZ'] = ' class="error"'; } if (!check_onlynumbers($_POST['PLZ'])) { $error = true; $errors['PLZ'] = ' class="error"'; } // Prüfung für das Feld "Ihr Ort" $errors['Ort'] = null; if (empty($_POST['Ort'])) { $error = true; $errors['Ort'] = ' class="error"'; } // Prüfung für das Feld "Ihr Land" $errors['Land'] = null; if (empty($_POST['Land'])) { $error = true; $errors['Land'] = ' class="error"'; } // Prüfung für das Feld "Ihr Telefon" $errors['Telefon'] = null; if (!check_onlynumbers($_POST['Telefon'])) { $error = true; $errors['Telefon'] = ' class="error"'; } // Prüfung für das Feld "Ihr MobilT" $errors['MobilT'] = null; if (!check_onlynumbers($_POST['MobilT'])) { $error = true; $errors['MobilT'] = ' class="error"'; } // Prüfung für das Feld "Ihr Reisetermin" $errors['Reisetermin'] = null; if (empty($_POST['Reisetermin'])) { $error = true; $errors['Reisetermin'] = ' class="error"'; } // Prüfung für das Feld "Anzahl der Reisenden" $errors['Reisende'] = null; if (empty($_POST['Reisende'])) { $error = true; $errors['Reisende'] = ' class="error"'; } } $_text_Vorname = (!empty($_POST['Vorname']) ? htmlspecialchars($_POST['Vorname'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Nachname = (!empty($_POST['Nachname']) ? htmlspecialchars($_POST['Nachname'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Strasse = (!empty($_POST['Strasse']) ? htmlspecialchars($_POST['Strasse'], ENT_QUOTES, 'iso-8859-15') : null); $_text_PLZ = (!empty($_POST['PLZ']) ? htmlspecialchars($_POST['PLZ'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Ort = (!empty($_POST['Ort']) ? htmlspecialchars($_POST['Ort'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Land = (!empty($_POST['Land']) ? htmlspecialchars($_POST['Land'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Telefon = (!empty($_POST['Telefon']) ? htmlspecialchars($_POST['Telefon'], ENT_QUOTES, 'iso-8859-15') : null); $_text_MobilT = (!empty($_POST['MobilT']) ? htmlspecialchars($_POST['MobilT'], ENT_QUOTES, 'iso-8859-15') : null); $_textarea_Sonstiges = (!empty($_POST['Sonstiges']) ? htmlspecialchars($_POST['Sonstiges'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Reisetermin = (!empty($_POST['Reisetermin']) ? htmlspecialchars($_POST['Reisetermin'], ENT_QUOTES, 'iso-8859-15') : null); $_text_Reisende = (!empty($_POST['Reisende']) ? htmlspecialchars($_POST['Reisende'], ENT_QUOTES, 'iso-8859-15') : null); $_textarea_Fragen = (!empty($_POST['Fragen']) ? htmlspecialchars($_POST['Fragen'], ENT_QUOTES, 'iso-8859-15') : null);
Danke für euer Hilfe!