Hey,
ich habe ein kleines Problem mit meinem Kontaktformular.
Ich habe jetzt 2 neue Felder hinzugefügt und seitdem wird nur noch die hälfte an meine E-Mail Adresse gesendet.
Könntet ihr bitte mal kurz drüberfliegen?
Vllt seht ihr ja noch etwas...
PS, ich erhalte auch noch folgende Fehler:
ZitatAlles anzeigenNotice: Undefined variable: info_error in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 64
Notice: Undefined variable: senders_email in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 81
Notice: Undefined variable: mail_message in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 97
Notice: Undefined variable: senders_name in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 123
Notice: Undefined variable: senders_email in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 127
Notice: Undefined variable: mail_subject in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 131
Notice: Undefined variable: senders_fahrzeugdaten in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 135
Notice: Undefined variable: senders_fahrgestellnummer in /var/www/web895/html/ssangyong-world/kontaktformular.php on line 139
Aber nun erstmal der Quellcode:
<?php
//////////////////////////////////////////////////////////////////////
///
/// Debugging / Fehler auf Seite anzeigen
///
//////////////////////////////////////////////////////////////////////
error_reporting(E_ALL);
ini_set('display_errors', 1);
//////////////////////////////////////////////////////////////////////
///
/// Textvariablen / Konfiguration
///
//////////////////////////////////////////////////////////////////////
$sendto_email = "unkenntlich_gemacht@hotmail.de";
$text_title = "<h2>E-Mail senden</h2>";
$text_no_tice = "Bitte füllen Sie alle Felder aus, um uns zu kontaktieren!<br><br>";
$text_name = "Ihr Name:";
$text_youremail = "Ihre E-Mail:";
$text_subject = "Betreff:";
$text_fahrzeugdaten = "Fahrzeugtyp, Motorisierung:";
$text_fahrgestellnummer = "Fahrgestellnummer:";
$text_message = "Nachricht:";
$text_confirmation = "Bitte Zeichenfolge abtippen:";
$text_submit = "Absenden";
$text_error = "Ihre E-Mail wurde nicht versendet, weil folgende Fehler aufgetreten sind:";
$text_no_name = "Sie haben keinen Namen eingegeben.";
$text_no_email = "Sie haben keine E-Mail Adresse eingegeben.";
$text_no_subject = "Sie haben keinen Betreff eingegeben.";
$text_no_message = "Sie haben keine Nachricht eingegeben.";
$text_invalidemail = "Die eingegebene E-Mail Adresse scheint ungültig zu sein.";
$text_sent = "Die E-Mail wurde gesendet! Folgende Nachricht wurde übermittelt:<br><br>";
$input_width = "300px";
$title_align = "left";
$title_css = "font-weight: bold; font-size: 120%;";
$error_colour = "red";
//////////////////////////////////////////////////////////////////////
///
/// Check ob Input-Felder ausgefuellt wurden
///
//////////////////////////////////////////////////////////////////////
extract($_POST);
if (empty ($senders_name))
{
$error = "1";
$info_error .= $text_no_name . "<br>";
}
if (empty ($senders_email))
{
$error = "1";
$info_error .= $text_no_email . "<br>";
}
if (empty ($mail_subject))
{
$error = "1";
$info_error .= $text_no_subject . "<br>";
}
if (empty ($mail_message))
{
$error = "1";
$info_error .= $text_no_message . "<br>";
}
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $senders_email))
{
$error = "1";
$info_error .= $text_invalidemail . "<br>";
}
if ($error == "1")
{
$info_no_tice = "<span style=\"color: " . $error_colour . "; font-weight: bold;\">" . $text_error . "</span><br>";
if (empty ($submit))
{
$info_error = "";
$info_no_tice = $text_no_tice;
}
$mail_message = stripslashes($mail_message);
//////////////////////////////////////////////////////////////////////
///
/// HTML Quellcode für Darstellung
///
//////////////////////////////////////////////////////////////////////
print "
<form name=\"mail-form\" method=\"post\" style=\"margin: 0;\" action=\"\">
<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"$title_align\" valign=\"middle\">
<td colspan=\"2\"><span style=\"$title_css\">$text_title</span></td>
</tr>
<tr align=\"left\" valign=\"middle\">
<td colspan=\"2\">$info_no_tice$info_error</td>
</tr>
<tr valign=\"middle\">
<td align=\"right\" >$text_name</td>
<td align=\"left\"><input name=\"senders_name\" type=\"text\" class=\"mailform_input\" id=\"senders_name\" style=\"width: $input_width;\" value=\"$senders_name\" maxlength=\"32\"></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_youremail</td>
<td align=\"left\"><input name=\"senders_email\" type=\"text\" class=\"mailform_input\" id=\"senders_email\" style=\"width: $input_width;\" value=\"$senders_email\" maxlength=\"64\"></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_subject</td>
<td align=\"left\"><input name=\"mail_subject\" type=\"text\" class=\"mailform_input\" id=\"mail_subject\" style=\"width: $input_width;\" value=\"$mail_subject\" maxlength=\"64\"></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_fahrzeugdaten</td>
<td align=\"left\"><input name=\"senders_fahrzeugdaten\" type=\"text\" class=\"mailform_input\" id=\"senders_fahrzeugdaten\" style=\"width: $input_width;\" value=\"$senders_fahrzeugdaten\" maxlength=\"64\"></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_fahrgestellnummer</td>
<td align=\"left\"><input name=\"senders_fahrgestellnummer\" type=\"text\" class=\"mailform_input\" id=\"senders_fahrgestellnummer\" style=\"width: $input_width;\" value=\"$senders_fahrgestellnummer\" maxlength=\"64\"></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_message</td>
<td align=\"left\"><textarea name=\"mail_message\" cols=\"36\" rows=\"5\" style=\"width: $input_width;\" class=\"mailform_input\">$mail_message</textarea></td>
</tr>
<tr valign=\"middle\">
<td align=\"right\"><td colspan=\"2\" align=\"right\"></td>
<td align=\"right\"><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"$text_submit\" class=\"mailform_button\"></td>
</tr>
</table>
</form>
";
}
//////////////////////////////////////////////////////////////////////
///
/// Sendeprozedur
///
//////////////////////////////////////////////////////////////////////
else
{
$info_no_tice = $text_sent;
$mail_message = stripslashes($mail_message);
$senders_email = preg_replace("/[^a-zA-Z0-9s.@-_]/", "-", $senders_email);
$senders_name = preg_replace("/[^a-zA-Z0-9s]/", " ", $senders_name);
$headers = "From: $senders_name <$senders_email> \r\n";
$headers .= "www.SsangYong-World.com :: Neue Nachricht \r\n";
mail($sendto_email, $mail_subject, $mail_message, $headers);
print " <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"$title_align\" valign=\"middle\">
<td colspan=\"2\"><span style=\"$title_css\">$text_title</span></td>
</tr>
<tr align=\"$title_align\" valign=\"middle\">
<td colspan=\"2\">$info_no_tice</td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_name</td>
<td align=\"left\"><b>$senders_name</b></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_youremail</td>
<td align=\"left\"><b>$senders_email</b></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_subject</td>
<td align=\"left\"><b>$mail_subject</b></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_fahrzeugdaten</td>
<td align=\"left\"><b>$senders_fahrzeugdaten</b></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_fahrgestellnummer</td>
<td align=\"left\"><b>$senders_fahrgestellnummer</b></td>
</tr>
<tr valign=\"middle\">
<td width=\"140\" align=\"right\">$text_message</td>
<td align=\"left\"><b>$mail_message</b></td>
</tr>
</table>";
}
?>
Alles anzeigen