Grillitussa Posted July 26, 2008 Share Posted July 26, 2008 Hi guys, i was hoping that one of you could be so kind to help me with my problem. The thing is i live in Iceland and we use characters like "æ ö þ ð á é í ó.." and so on and my PHP form does not display them correctly i can hardly read my customers requests that come from my web page. I am going to display my code in hope that there is some one out there that could help me solve this problem. best regards, Vilhjalmur. here goes the code. For those of you that want to understand the icelandic words "Nafn = Name" "Netfang = Email" "Simi = Phone" "Skilabod = Messages" <?php $Nafn = $_POST['Nafn']; $Netfang = $_POST['Netfang']; $Simi = $_POST['Simi']; $Skilabod = $_POST['Skilabod']; $isl = array('á','é','ý','ú','í','ó','ö','þ','ð','æ','Á','É','Ý','Ú','Í','Ó','Ö','Þ','Ð','Æ'); $ens = array('a','e','y','u','i','o','o','th','d','ae','A','E','Y','U','I','O','O','TH','D','AE'); $skilabod = str_replace($isl,$ens,$skilabod); $message = 'Nafn: ' . $Nafn .' Netfang: ' . $Netfang .' Skilabod: ' .$Skilabod .' Simi: ' .$Simi; $to = '[email protected]'; $subject = 'Fyrirspurn fra einkathjalfari.is'; if (!mail($to, $subject, $message)){ header('Location:gekk_ekki.html'); } else { header('Location:gekk.html'); } ?> Link to comment https://forums.phpfreaks.com/topic/116773-problem-with-php-email-form-and-utf-8/ Share on other sites More sharing options...
JasonLewis Posted July 27, 2008 Share Posted July 27, 2008 Look at this line: $skilabod = str_replace($isl,$ens,$skilabod); You are using lowercase 's' whereas your variable you declared earlier, which holds the actual message has an uppercase 'S'. Then later on in your $message variable you use the uppercase 'S' which means that nothing would've been changed. Try changing the line to this: $Skilabod = str_replace($isl,$ens,$Skilabod); Link to comment https://forums.phpfreaks.com/topic/116773-problem-with-php-email-form-and-utf-8/#findComment-600663 Share on other sites More sharing options...
Grillitussa Posted July 27, 2008 Author Share Posted July 27, 2008 True True, but can't i do some thing so that i get those letters in to my mail? My way only changes Æ in to AE and Þ in to TH and so on. Link to comment https://forums.phpfreaks.com/topic/116773-problem-with-php-email-form-and-utf-8/#findComment-600857 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.