PDA

View Full Version : فارسی نویسی در php



دانیال دزفولی
چهارشنبه 21 اسفند 1392, 19:26 عصر
سلام
برای اینکه اطلاعاتی به یه ایمیل با php بفرستم با فارسی نمیشه

چه کدی هست برای php که بشه این کارو کرد؟

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 19:43 عصر
komakkkkkkkkkkkkkkkk

mahmod2000
چهارشنبه 21 اسفند 1392, 20:35 عصر
Header که برای ارسال ایمیل میفرستید UTF-8 کنید


$headers= "Content-Type: text/plain;charset=utf-8\r\n";
یا



$headers= "Content-Type: text/html;charset=utf-8\r\n";

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 21:30 عصر
واقعا دستتون درد نکنه

کل اینرنت رو زیر رو کردم هیچ کدوم کار نمیکرد از جمله همین کد




* دالر هدر چه کاری معنیش چیه؟










کد هایی که ازشون استفاده میکنم



<?phpmysql_set_charset('utf8');$to = 'danielmerikhi@yahoo.com';$subject = 'تماس'; // message$message = '<!doctype html><html> <head> <meta charset="utf-8"> <title>Birthday Reminders for August</title></head><body><p>Here are the birthdays upcoming in August!</p><table><tbody><tr><th>نام</th><th>Day</th><th>Month</th><th>Year</th></tr><tr><td>Joe</td><td>3rd</td><td>August</td><td>1970</td></tr><tr><td>Sally</td><td>17th</td><td>August</td><td>1973</td></tr></tbody></table></body></html>';
// To send HTML mail, the Content-type header must be set$headers = 'MIME-Version: 1.0' . "\r\n";$headers= "Content-Type: text/plain;charset=utf-8\r\n";$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";mail($to, $subject, $message, $headers);
$mail->CharSet = 'UTF-8';?>


خروجی:(در ایمیل)


Here are the birthdays upcoming in August!
نامDayMonthYearJoe3rdAugust1970Sally17t hAugust1973

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 21:30 عصر
<?phpmysql_set_charset('utf8');
$to = 'danielmerikhi@yahoo.com';
$subject = 'تماس';
// message
$message = '
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Birthday Reminders for August</title>
</head>
<body><p>Here are the birthdays upcoming in August!</p>
<table>
<tbody>
<tr><th>نام</th><th>Day</th><th>Month</th><th>Year</th></tr>
<tr>
<td>Joe</td>
<td>3rd</td>
<td>August</td>
<td>1970</td>
</tr>
<tr>
<td>Sally</td>
<td>17th</td>
<td>August</td>
<td>1973</td>
</tr>
</tbody>
</table></body>
</html>
';


// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers= "Content-Type: text/plain;charset=utf-8\r\n";
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
mail($to, $subject, $message, $headers);


?>

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 21:32 عصر
Here are the birthdays upcoming in August!


نام
Day
Month
Year


Joe
3rd
August
1970


Sally
17th
August
1973

tux-world
چهارشنبه 21 اسفند 1392, 22:09 عصر
از این کد بالای صفحه استفاده کردید؟


<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 22:27 عصر
<?phpmysql_set_charset('utf8');
$to = 'danielmerikhi@yahoo.com';
$subject = 'تماس';
// message
$message = '
<!doctype html>
<html>
<head>
<meta charset="utf-8">


بله

p30online
چهارشنبه 21 اسفند 1392, 22:37 عصر
اینو اول فایلت بگذار



header('Content-Type:text/html; charset=utf-8');

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 22:48 عصر
مشکل حل نشد

دانیال دزفولی
چهارشنبه 21 اسفند 1392, 23:29 عصر
من که به نتیجه ای نرسیدم

p30online
چهارشنبه 21 اسفند 1392, 23:42 عصر
از من که می فرسته ،بیا این هم کدهای من:



<?php
header('Content-Type:text/html; charset=utf-8');
if(isset($_POST['email'])){
$email_address='p30online@yahoo.com';
$email_name = "succesfull";

$formtext1 = $_POST['name'];
$formtext2 = $_POST['email'];
$formtext3 = $_POST['tel'];
$formtext4 = $_POST['website'];
$formtext5 = $_POST['message'];

$msg_body = "NAME: $formtext1\n";
$msg_body .= "EMAIL: $formtext2\n";
$msg_body .= "TEL: $formtext3\n";
$msg_body .= "WEBSITE: $formtext4\n";
$msg_body .= "MESSAGE: $formtext5\n";

$headers = "";
$headers .= "From: " . $email_name . " <" . $email_address . ">\n";
$headers .= "X-Sender: <" . $email_address . ">\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: <" . $email_address . ">\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";

@mail($email_address, "mysite", "<pre>" . $msg_body . "</pre>", $headers);

echo "<center>ایمیل با موفقیت ارسال شد!</center>";
header('location:index.html#message');
exit;
}else{
}
?>

دانیال دزفولی
پنج شنبه 22 اسفند 1392, 10:52 صبح
ممکنه مشکل از هاست رایگانم باشه؟

tux-world
جمعه 23 اسفند 1392, 06:26 صبح
دستتون درد نکنه. بعد ایییییییییییییین همه سوال و پاسخ تازه یادتون افتاده اینو بگید؟
مثالهایی که براتون زدن همشون درسته. ایراد از جای دیگست.

دانیال دزفولی
جمعه 23 اسفند 1392, 09:47 صبح
من نمیدونستم ممکنه ربط داشته باشه :لبخند::لبخند::لبخند::لبخند:: بخند::لبخند::لبخند::لبخند: