PHP เป็นภาษาต่างด้าว...แก้ไงครับ

เริ่มโดย mr.zatan, 27 สิงหาคม 2013, 15:47:09

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

mr.zatan

ตามรูปครับ

ภาษาไทยจะเป็น ภาษาต่างด้าว....




นี่ Code ที่ผมใช้



<?php
/* sending e-mail with the order to the visitors email*/

$to
$_POST['jcremite'];

$subject 'ข้อมูลการสั่งซื้อ';

$jcitems '
<style type="text/css">




body,td,th {
color: #033;
font-family: Tahoma, Geneva, sans-serif;
}
.ORDERINVOICE {
color: #FFF;
font-weight: bold;
font-size: 24px;
}
.ORDERINVOICE strong {
color: #FFF;
font-size: 24px;
}
.head2 {
color: #F00;
font-weight: bold;
font-size: 16px;
}
head1 {
color: #060;
}
.headd1 {
color: #066;
font-size: 14px;
}
.headd1 .headd1 {
font-size: 18px;
font-weight: bold;
color: #060;
}
.head2 strong {
font-weight: normal;
font-size: 24px;
}
.head2 strong {
font-weight: bold;
}
.head2 strong {
font-style: italic;
}
.head2 strong {
font-style: normal;
font-size: 16px;
}
.head2 .headd1 .head2 {
font-weight: bold;
font-size: 16px;
}




</style>
</style>
<body text="#CC6666" style="background-color: #; none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">
<table width="511" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="511" height="53" bgcolor="#0399d0" class="ORDERINVOICE" ><p><strong>ORDER<span id="00101"> INVOICE</span></strong></p></td>
  </tr>
  <tr>
    <td height="118" align="left" valign="top" bgcolor="#f3fcff"><p class="head2"><strong>ข้อมูลลูกค้า :</strong><strong><br />
    </strong><span class="coll23"><span class="coll1"><span class="aada"><span class="ttt3r"><span class="sasasas"><strong class="coll23"><span class="head2"><span class="headd1">&nbsp;&nbsp; ชื่อ:</span></span>&nbsp; </strong></span></span></span></span></span><span style="margin: 4px 0pt; padding: 4px 0pt; font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 18px; color: rgb(51, 51, 51); text-align: center;">'
$_POST['buyername'] .'
<br>
</span><span class="headd1">อีเมล์:&nbsp; </span><span style="margin: 4px 0pt; padding: 4px 0pt; font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 18px; color: rgb(51, 51, 51); text-align: center;">'
$_POST['jcremite'] . '<br>
    </span><span class="headd1">&nbsp; โทร: </span> &nbsp;<span style="margin: 4px 0pt; padding: 4px 0pt; font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 18px; color: rgb(51, 51, 51); text-align: center;">'
$_POST['buyerhp'] . '<br>
    </span><span class="head2"><span class="headd1">&nbsp;ที่อยู่: </span></span> &nbsp;<span style="margin: 4px 0pt; padding: 4px 0pt; font-family: Arial,Helvetica,sans-serif; font-size: 12px; line-height: 18px; color: rgb(51, 51, 51); text-align: center;">'
$_POST['buyeralamat'] . '</span></p></td>
  </tr>
  <tr>
    <td height="70" align="left" valign="top" bgcolor="#e4f6fc"><p class="head2"><span class="headd1"><span class="head2">รายการที่สั่งซื้อ :<br />
    </span></span><span style="margin: 4px 0pt; padding: 4px 0pt; font-family: Arial,Helvetica,sans-serif; font-size: 14px; line-height: 18px; color: #30F; text-align: left; font-weight: normal;">'
$_POST['jcitems'] . '</span></p></td>
  </tr>
  <tr>
    <td height="19" align="left" valign="top" bgcolor="#d1f0fc"><p class="headd1"><span class="head2">การชำระงิน :</span><br />
        <br />
    </p></td>
  </tr>
  <tr align="center">
    <td height="51" valign="middle" bgcolor="#0399d0"><p class="ttt3r">&nbsp;</p></td>
  </tr>
</table>
</body>
'
;
$headers 'From: ' $_POST['businessName'] . '<' $_POST['email'] . '>'."\r\n" ;

'Reply-To:' $_POST['email'] . "\r\n" ;
$headers .= 'MIME-Version: 1.0' "\r\n";   $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to$subject$jcitems$headers); 


// /* sending e-mail to the shop email */   
$to
$_POST['email'];  $subjectAdmin 'ข้อมูลการสั่งซื้อ';    $jcitemsAdmin '<html>
<style type="text/css">
.sasasas {
font-size: 18px;
}
.aada {
font-weight: bold;
font-size: 24px;
}
.mini233 {
font-size: 18px;
}
.coll1 {
color: #F00;
font-weight: bold;
font-size: 18px;
}
.coll23 {
font-size: 24px;
}
.coll25 {
color: #F00;
font-size: 24px;
}
.cssd {
font-weight: bold;
}
.cssd {
font-size: 24px;
color: #F00;
font-weight: bold;
}
.ttt3r {
font-size: 24px;
color: #FFF;
font-weight: bold;
}
.gggf {
font-size: 20px;
}
.title1 {
font-size: 18px;
}
</style>
<body>
<p><span class="mini233">เรียนผู้ประกอบการ ขณะนี้มีคำสั่งซื้อเข้ามา</span> <b>' 
$_POST['businessName'] . '</b><br/><br/> 
  <span class="aada"><span class="mini233"><span class="coll25">รายการที่สั่งซื้่อ :</span></span></span><br/>' 
$_POST['jcitems'] . '<br/>    <br/>
  <span class="cssd">ข้อมูลลูกค้า :</span><br/>===============================================    <br/>Email : ' 
$_POST['jcremite'] . '<br/>Name : ' $_POST['buyername'] .    '<br/>Address :'$_POST['buyeralamat'] . '<br/>Phone Number : '$_POST['buyerhp'] . '<br/>===============================================  </p>
<p>&nbsp;</p>
</body></html>'
;  $headers 'From: Zone-shoppinG <'.$_POST['jcremite'].'>'."\r\n" ;

'Reply-To:' $_POST['jcremite'] . "\r\n" $headers .= 'MIME-Version: 1.0' "\r\n";   $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to$subjectAdmin$jcitemsAdmin$headers);


/*Clearing the cart info after succesfull order is made*/

setcookie ("simpleCart"""time() - 3600);



header('Location: http://www.');

die;

?>




ขอบคุณล่าวงหน้า...

:wanwan017:

supaman

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

html5
<meta charset="utf-8" />

ประกาศไว้ที่ head ครับ

i3ank

อ้างถึงจาก: supaman ใน 27 สิงหาคม 2013, 15:50:16
html
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

html5
<meta charset="utf-8" />

ประกาศไว้ที่ head ครับ

ตามท่านนี้ครับ  utf-8

$headers .= 'MIME-Version: 1.0' . "\r\n";   $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

ขายระบบ [direct=https://www.playerth.com/]Proxy JwPlayer for Google Drive[/direct]
รับทำระบบดึงลิงค์วิดีโอจากเว็บไซต์ต่างๆ
ติดต่อ Email : [email protected]

mr.zatan


ab5olute

host ที่ใช้อยู่ ต่างประเทศ หรือป่าวครับ

ekateikate

ใส่ mysql_query("SET NAMES UTF8");
หลัง sql_connect


ถ้ายั่งไม่ได้ ให้ save file เป็น utf


:wanwan020: :wanwan020: :wanwan020:
[direct=https://www.jitjai.com]Jitjai.com[/direct]

BeerSkz

ต้องใส่โค้ด html ให้ head ให้ครบนะครับ ไม่งั้นก็จะเป็นงี้แหละครับ ตาม เม้นบนครับ utf8

เกมส์เกมส์.com

อันเก่า tis-620 อันใหม่ utf-8 รึเปล่าครับ

ลองไปดูใน mysql ดูครับว่ามันอ่านรู้เรื่องรึเปล่า

น่าจะต้องลองส่งออกและนำเข้า แบบแมนวล เพิ่มตารางด้วยคำสั้ง sql ให้ใช้ utf-8 ทั้งหมด เพิ่มที่ละอันตาราง แล้วค่อยๆแทรกข้อมูล ด้วยคำสั้ง sql เข้าไป
[direct=http://www.thaiseoboard.com/index.php/topic,191657.0.html]##โปรโมชั่น ## seo ลุ้นเสียว 1000 บาท/คีย์ +++  3คีย์แถม 1 คีย์+++ รับทำ seo แฟนเพจ top 10 เพียง 3000/คีย์[/direct]

adidog

Certain Dri [direct=http://www.ishiclub.com/]Certain Dri[/direct]
คุณแม่มือใหม่ [direct=http://www.mamyget.com/]คุณแม่มือใหม่[/direct]

pEEr@pong

ลองดูว่า ทำ 3 ขั้นตอนนี้หรือยังนะครับ

1.

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

2.

ใส่ mysql_query("SET NAMES UTF8");
หลัง sql_connect

3.

save file encode เป็น  utf8

:wanwan020: :wanwan020:








รับออกแบบ > ติดตั้ง > ปรับแต่ง > CMS > Wordpress > SMF > Opencart
---------------------------------------------------------------------------
1. Wordpress : รับติดตั้ง และออกแบบ Theme Wordpress ตามสั่ง ราคากันเอง
2. SMF : รับติดตั้ง และออกแบบ Theme SMF ตามสั่ง ราคากันเอง
3. Opencart : รับติดตั้ง และออกแบบ Theme Opencart ตามสั่ง ราคากันเอง
4. PSD : รับแก้ไข และตัด PSD to Wordpress / PSD to HTML+CSS ราคากันเอง
5. PHP : รับแก้ไขเฉพาะจุด และทำระบบด้วย PHP ตามสั่ง ราคากันเอง
6. CSS
---------------------------------------------------------------------------
ติดต่อดู ผลงานที่ผ่านมา ได้ทาง PM

mr.zatan

#10
ทำได้แย้วครับบบ...

$headers .= 'MIME-Version: 1.0' . "\r\n";   $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

เปลี่ยนเป็น

$headers .= 'MIME-Version: 1.0' . "\r\n";   $headers .= "Content-Type: text/html; charset=utf-8";



ไม่รู้ถูกรึเปล่าว แต่ผลลัพท์ที่ได้ตรงตามที่ต้องการ....ครับ  ขอบคุณมากๆๆทุกคนครับ.. :wanwan019: :wanwan019: :wanwan019: :wanwan019: :wanwan019: :wanwan019:


thesakinry

อ้างถึงจาก: เกมส์เกมส์.com ใน 27 สิงหาคม 2013, 16:36:53
อันเก่า tis-620 อันใหม่ utf-8 รึเปล่าครับ

ลองไปดูใน mysql ดูครับว่ามันอ่านรู้เรื่องรึเปล่า

น่าจะต้องลองส่งออกและนำเข้า แบบแมนวล เพิ่มตารางด้วยคำสั้ง sql ให้ใช้ utf-8 ทั้งหมด เพิ่มที่ละอันตาราง แล้วค่อยๆแทรกข้อมูล ด้วยคำสั้ง sql เข้าไป

ประมาณนี้ครับ มีสคริป Gen ให้มันเป็น UTF หมดอยู่ ลองหาดูครับ

ghostbehead

อ้างถึงจาก: pEEr@pong ใน 27 สิงหาคม 2013, 16:59:29
ลองดูว่า ทำ 3 ขั้นตอนนี้หรือยังนะครับ

1.

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

2.

ใส่ mysql_query("SET NAMES UTF8");
หลัง sql_connect

3.

save file encode เป็น  utf8

:wanwan020: :wanwan020:










อ้างถึงจาก: ekateikate ใน 27 สิงหาคม 2013, 16:30:56
ใส่ mysql_query("SET NAMES UTF8");
หลัง sql_connect


ถ้ายั่งไม่ได้ ให้ save file เป็น utf


:wanwan020: :wanwan020: :wanwan020:

ตามนี้ครับ :)
[direct=http://tinytastebake.com/]ขาย Brownie Brownie Cracker[/direct][direct=http://shoesdeedee.com/]ขายคอนเวิร์สมือสอง รองเท้ามือสอง[/direct]<br />[direct=http://isareeya.com/]บทความ ข่าวสาร เทคโนโลยี[/direct]<br />[direct=http://sangsanweb.com/]รับทำเว็บไซต์ PHP Wordpress[/direct]