rx3mer Posted August 5, 2010 Share Posted August 5, 2010 Hey My problem with the form is that when i write in Bulgarian and send the message I recive email with all sort of characters but not Bulgarian. I have uploaded the file becouse it looks wors in the forum <?php // $uploaded_file = array("txt","doc","docx"); foreach ($_FILES as $file) { if ($file['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($file['name']))), $uploaded_file)) { die($file['name'].' файлът не невалиден!<br/>'. '<a href="javascript:history.go(-1);">'. '<< Назад</a>'); } } } $target_path = "uploads/"; echo "<p>Благодаря ви <b>$_POST[name]</b>, Ващето съобщение беше изпратено успешно.</p>"; /*Моля промени: echo "The file http://blog-bored.com/websites/translateagency/uploads/". с сайта в който ще се качва файла. Трябва да имаш папка uploads с 777 разрешение.*/ $target_path = $target_path . basename( $_FILES['uploaded_file']['name']); if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path)) { echo "The file http://blog-bored.com/websites/translateagency/uploads/". basename( $_FILES['uploaded_file']['name']). " has been uploaded"; } else{ echo "Грешка при качване на файла!"; } $name=$_POST['name']; $familiq=$_POST['familiq']; $telefon=$_POST['telefon']; $grad=$_POST['grad']; $durjava=$_POST['durjava']; $email=$_POST['email']; $syobshtenie=$_POST['syobshtenie']; $target_path=$_POST['uploaded_file']; $to = "raddy@inked-world.com"; $subject="Translation Agency - Нов документ"; $message=""; $message.= "Dear Admin,<br><br>\n"; $message.= "Имате ново писмо от Translation Agency.<br><br>\n"; $message.= "Детайли<br><br>\n"; $message.= ".....................................<br><br>\n"; $message.="<b>Име:</b> ".$name.".<br><br>\n"; $message.="<b>Фамилия:</b> ".$familiq.".<br><br>\n"; $message.="<b>Телефон:</b> ".$telefon.".<br><br>\n"; $message.="<b>Град:</b> ".$grad.".<br><br>\n"; $message.="<b>Държава:</b> ".$durjava.".<br><br>\n"; $message.="<b>Email:</b> ".$email.".<br><br>\n"; $message.="<b>Съобщение:</b> ".$syobshtenie.".<br><br>\n"; $message.="<b>Прикачен файл:</b> http://traduttore.ueuo.com/uploads/".basename( $_FILES['uploaded_file']['name'])."<br><br>\n"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From:".$name."<".$email.">\r\n"; $headers .= "Reply-To:".$name."<".$email.">\r\n"; $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n"; $headers .= "X-Priority: 1"; mail($to,$subject,$message,$headers); ?> <a href="#"><b>Back</b></a> [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/209890-help-php-email-upload-form-encoding-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.