Jump to content

Help - Php email upload form encoding problem...


rx3mer

Recommended Posts

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);">'.
        '<&lt Назад</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 = "[email protected]";
$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]

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.