Jump to content

Æ, Ø, Å Problem


norNerd

Recommended Posts

Heres the header

<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link href="style/style1.css" rel="stylesheet" type="text/css" /><title>TDR - Tolk døgnet rundt</title>And then some script apps and stylesheets here.</head>

Then the PHP script

<?phpif(isset($_POST['send'])){	$name 		= $_POST['name'];	$email		= $_POST['email'];	$subject	= $_POST['subject'];	$text_added	= $_POST['text_added'];			$text = "Melding fra: ".$_POST['name']."				 E-post: ".$_POST['email']."				 Emne: ".$_POST['subject']."				 				 $name skrev:				 ".$_POST['text_added']."";				$to = "nerd@norclick.com";		$thankyou_text = "";		mail("$to", "".$_POST['subject']."", "$text", "From: <".$_POST['email'].">");		mail("$email","Takk for henvendelsen","$thankyou_text","From: <$to>");		echo "<script>alert('Din henvendelse ble sendt til Tolk Døgnet Rundt.');</script>";		echo "<script>location.href='index.php?page=index';</script>";}																		 ?>

Know this code has some "security" issues but i think its best to get it to work before i add more code :)Anyone know why it send æ, ø, å like Ã?, Ã~, Ã. when i post message thru the form?Have had alot of truble with this before, and never found a solution that worked on all sites :sKris

Link to comment
Share on other sites

You can set some additional, optional mail headers which set content types, for example I use:$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";But you will probably need to change it to$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";Note that this allows the sending of html mail, you can swap text/html to text/plain if you don't need that option.

Link to comment
Share on other sites

Hi chibineku, thanks :)I changed code to:

<?php		$headers = 'MIME-Version: 1.0' . "\r\n";		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";				$thankyou_text = "Takk for hendevendelsen til oss i Tolk Døgnet Rundt.						  Vi tar kontakt etter vi har gått igjennom hendvendelsen.						  						  MVH						  Tolk Døgnet Rundt						  [url="http://tdr.no";"]http://tdr.no";[/url]		mail("$to", "".$_POST['subject']."", "$text", "From: <".$_POST['email'].">", "$headers");																	 ?>

And got the same problem, what am i doing wrong?Kris

Link to comment
Share on other sites

That was my sole idea, I'm afraid :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...