Aner det ikke .. Jeg troede det blev defineret i UTF charset :)
Jeg håber det er OK ellers må du sige til så sletter jeg det igen.
Jeg har kopieret koden ind her - først html og dernæst php.
Jeg håber det giver mening ...
Følgende kode er indsat i kontakt.html:
<form action="feedback.php" method="post" id="tswfbform" accept-charset="UTF-8">
<label for="tswname">Name</label> <input type="text" name="fullname" style="max-width: 100%;" id="tswname" size="39" /><br /> <br />
<label for="tswemail">Email</label> <input type="text" style="max-width: 100%;" id="tswemail" name="email" size="39" /><br /> <br />
<label for="tswtel">Telephone</label> <input type="text" id="tswtel" style="max-width: 100%;" name="tel" size="39" /><br /> <br />
<label for="tswcomments">Comments</label><br /> <br />
<textarea rows="15" cols="45" name="comments" style="max-width: 100%;" id="tswcomments"></textarea>
<br /> <br />
<input id="tswsubmit" type="submit" value="Send Feedback" />
</form>
Følgende kode er indsat i feedback.php
// ------------- CONFIGURABLE SECTION ------------------------
$mailto = 'per@tmpm.dk' ;
$subject = "Email Feedback Form" ;
$formurl = "
http://tmpm.dk/feedback.html" ;
$thankyouurl = "
http://www.tmpm.dk/thankyou.html" ;
$errorurl = "
http://tmpm.dk/error.html" ;
$want_tel_field = 1;
$want_addr_field = 0;
$email_is_required = 1;
$name_is_required = 1;
$comments_is_required = 1;
$uself = 0;
$use_envsender = 0;
$use_sendmailfrom = 0;
$smtp_server_win = '' ;
$use_webmaster_email_for_from = 0;
// -------------------- END OF CONFIGURABLE SECTION ---------------
define( 'MAX_LINE_LENGTH', 998 );
define( 'CONTENT_TYPE', 'Content-Type: text/plain; charset="utf-8"' );
$linesep = $uself ? "\n" : "\r\n" ;
if ($use_sendmailfrom) {
ini_set( 'sendmail_from', $mailto );
}
if (strlen($smtp_server_win)) {
ini_set( 'SMTP', $smtp_server_win );
}
$envsender = "-f$mailto" ;
$fullname = trim($_POST['fullname']) ;
$email = trim($_POST['email']) ;
$comments = $uself ? preg_replace( '/\r\n/', "\n", $_POST['comments'] ) : $_POST['comments'] ;
$http_referrer = $_SERVER['HTTP_REFERER'];
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (($email_is_required && (empty($email) || (substr_count($email,'@') != 1))) || (strlen($email) > 254) || preg_match("/[\s<>,;'\"]/", $email) ||
($name_is_required && empty($fullname)) || (strlen($fullname) > 729) || preg_match("/[\r\n@<>,;\"]/", $fullname) ||
($comments_is_required && empty($comments))) {
header( "Location: $errorurl" );
exit ;
}
if (empty($email)) {
$email = $mailto ;
}
$fromemail = $use_webmaster_email_for_from ? $mailto : $email ;
if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$opt_flds = $want_addr_field ? "Address: " . $_POST['addr'] . $linesep : '' ;
$opt_flds .= $want_tel_field ? "Telephone: " . $_POST['tel'] . $linesep : '' ;
$messageproper =
"This message was sent from:" . $linesep .
$http_referrer . $linesep .
"------------------------------------------------------------" . $linesep .
"Name of sender: $fullname" . $linesep .
"Email of sender: $email" . $linesep .
$opt_flds .
"------------------------- COMMENTS -------------------------" . $linesep . $linesep .
$comments . $linesep . $linesep .
"------------------------------------------------------------" . $linesep ;
$messageproper = wordwrap( $messageproper, MAX_LINE_LENGTH, $linesep, true ) ;
$headers =
"From: \"$fullname\" <$fromemail>" . $linesep . "Reply-To: \"$fullname\" <$email>" . $linesep . "X-Mailer: chfeedback.php 3.0.0" .
$linesep . 'MIME-Version: 1.0' . $linesep . CONTENT_TYPE ;
if ($use_envsender && !ini_get('safe_mode')) {
mail($mailto, $subject, $messageproper, $headers, $envsender );
}
else {
mail($mailto, $subject, $messageproper, $headers );
}
header( "Location: $thankyouurl" );
exit ;
?>