Hallo,
habe ein Kontaktformular eingefügt, welches auch funktioniert. Nur die Umlaute in den ankommenden Nachrichten werden nicht richtig angezeigt.
Bin Neuling und keine richtige Ahnung wo ich was ändern könnte.
Hier mal der Code:
Hat jemand eine Lösung?
habe ein Kontaktformular eingefügt, welches auch funktioniert. Nur die Umlaute in den ankommenden Nachrichten werden nicht richtig angezeigt.
Bin Neuling und keine richtige Ahnung wo ich was ändern könnte.
Hier mal der Code:
Code:
[COLOR=#000000]<!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>
[COLOR=#0000bb]<?php
[/COLOR][COLOR=#ff8000]// *** Deine Mailadresse (Empfänger) ***
[/COLOR][COLOR=#0000bb]$mail_to[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"deine@mailadresse.com"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#ff8000]// *************************************
[/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'fromname'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]strtolower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'frommail'[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'mailsubject'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'mailtext'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000bb]$send[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'s'[/COLOR][COLOR=#007700]];
if([/COLOR][COLOR=#0000bb]trim[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700])==[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Bitte gib Deinen Namen an.<br>"[/COLOR][COLOR=#007700];
if([/COLOR][COLOR=#0000bb]trim[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700])==[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Bitte gib Deine E-Mail-Adresse an.<br>"[/COLOR][COLOR=#007700];
else
if(![/COLOR][COLOR=#0000bb]ereg[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700]))
[/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Bitte gib eine gültige E-Mail-Adresse an.<br>"[/COLOR][COLOR=#007700];
if([/COLOR][COLOR=#0000bb]trim[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700])==[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Bitte gib einen Betreff ein.<br>"[/COLOR][COLOR=#007700];
if([/COLOR][COLOR=#0000bb]trim[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700])==[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Bitte gib einen Nachrichtentext ein.<br>"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#ff8000]// *** Zu langen Text abschneiden ***
[/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700])>[/COLOR][COLOR=#0000bb]1000[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]substr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]1000[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#dd0000]"... (Text wurde gekürzt!)"[/COLOR][COLOR=#007700];
}
[/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]chr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]34[/COLOR][COLOR=#007700]),[/COLOR][COLOR=#dd0000]"''"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]chr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]34[/COLOR][COLOR=#007700]),[/COLOR][COLOR=#dd0000]"''"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]);
if(([/COLOR][COLOR=#0000bb]$send[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#dd0000]"1"[/COLOR][COLOR=#007700]) && (isset([/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700]))) {
echo [/COLOR][COLOR=#dd0000]"<p><big><b>Fehler:</b></big><br>"[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#dd0000]"$err_text</p>"[/COLOR][COLOR=#007700];
}
if(([/COLOR][COLOR=#0000bb]$send[/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]"1"[/COLOR][COLOR=#007700]) || (isset([/COLOR][COLOR=#0000bb]$err_text[/COLOR][COLOR=#007700])))
{
[/COLOR][COLOR=#0000bb]?>
[/COLOR]
<form action="[COLOR=#0000bb]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'PHP_SELF'[/COLOR][COLOR=#007700]]; [/COLOR][COLOR=#0000bb]?>[/COLOR]" 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="[COLOR=#0000bb]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000bb]$from_name[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]?>[/COLOR]"></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="[COLOR=#0000bb]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000bb]$from_mail[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]?>[/COLOR]"></td></tr>
<tr><td nowrap align=right>Betreff:</td><td></td>
<td width=100%><input type="text" name="mailsubject" size=50 maxlength=120 value="[COLOR=#0000bb]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]?>[/COLOR]"></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">[COLOR=#0000bb]<?php [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]?>[/COLOR]</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>
[COLOR=#0000bb]<?php
[/COLOR][COLOR=#007700]} else {
[/COLOR][COLOR=#0000bb]$header[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"From: $from_name <$from_mail>\n"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$header[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Reply-To: $from_mail\n"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$header[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"X-Mailer: PHP-FormMailer (www.gaijin.at)\n"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$header[/COLOR][COLOR=#007700].=[/COLOR][COLOR=#dd0000]"Content-Type: text/plain"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$mail_date[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]gmdate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"D, d M Y H:i:s"[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#dd0000]" +0000"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$send[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700];
if(@[/COLOR][COLOR=#0000bb]mail[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_to[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$mail_subject[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$header[/COLOR][COLOR=#007700]))
{
echo [/COLOR][COLOR=#dd0000]"<p><b>Deine E-Mail wurde abgesendet.</b></p>"[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#dd0000]"<p><a href=\""[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'PHP_SELF'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#dd0000]"?from_name=$from_name&from_mail=$from_mail\">Zurück zum Formular</a></p>"[/COLOR][COLOR=#007700];
}else{
echo [/COLOR][COLOR=#dd0000]"<p><b>Beim Versenden der E-Mail ist ein Fehler aufgetreten!</b></p>"[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#dd0000]"<p><a href=\""[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'PHP_SELF'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#dd0000]"?from_name=$from_name&from_mail=$from_mail&mail_subject=$mail_subject&mail_text="[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#0000bb]urlencode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mail_text[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#dd0000]"\">Zurück zum Formular</a></p>"[/COLOR][COLOR=#007700];
}
}
[/COLOR][COLOR=#0000bb]?>
[/COLOR]
<p><a href="http://www.gaijin.at/">Copyright © 2003-2007 www.gaijin.at</a></p>
</body>
</html> [/COLOR]