Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > เขียนสคริปส่งเมล์แต่ไม่สามารถแสดงค่าที่อยู่ในตัวแปรที่ส่งไปใครรู้บ้างครับพี่น้องครับสงเคราะห์ผมที



 

เขียนสคริปส่งเมล์แต่ไม่สามารถแสดงค่าที่อยู่ในตัวแปรที่ส่งไปใครรู้บ้างครับพี่น้องครับสงเคราะห์ผมที

 



Topic : 045181



โพสกระทู้ ( 0 )
บทความ ( 0 )



สถานะออฟไลน์




ผมเขียนระบบช๊อปปิ้งชาตติดตรงที่เวลาลูกค้าสั่งซื้อแล้วระบบผมจะต้องส่งเมล์บอกว่าลูกค้าเค้าสั่งซื้ออะไรบ้าง จำนวนกี่ชิ้น ราคารวมเท่าไหร่ ไปยังอีเมล์เค้า ทีนี้ผมเขียนระบบส่งเมล์ได้แล้วแต่ติดตรงที่ไม่สามารถแสดงจำนวนสินค้า หรือว่าราคา ที่กำหนดโดยตัวแปร php ได้ส่งเมล์ไปมันไม่โชวร์ข้อมูลที่เป็นตัวแปรเลยอะครับ ใครพอจะแนะนำได้บ้างครับช่วยทีครับหรือใครมีวิธีอื่นบ้าเค้าทำกันแบบที่ผมทำรึเปล่าช่วยบอกทีผมก็พึ่งเขียนครั้งแรก

ขอบคุณครับ



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-07-08 22:33:54 By : chittipong View : 1110 Reply : 3
 

 

No. 1



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


มันก็เหมือนเขียนหน้าเว็บธรรมดานี่แหละครับ เชื่อมสตริงให้ถูกต้อง แล้วแน่ใจหรอว่าตัวแปรมีค่า

เอาโค๊ดที่เขียนมาแปะ เดี๋ยวมีคนมาช่วยเยอะแยะ






Date : 2010-07-09 01:54:37 By : plakrim
 


 

No. 2

Guest


ประมาณนี้ครับพี่ คือมันจะรับค่า session มาจากหน้า order อีกทีครับพอรันมันได้ทุกอย่างยกเว้นโชว์ค่าตัวแปรออกมา

Code (PHP)
<?php 
session_start();
?>

<?php include("include/convertmoney_inc.php"); ?>
<?   include"Connections/connect.php"; ?>
<?php
// multiple recipients
$to  = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';

// subject
$subject = 'ท่านได้สั่งซื้อสินค้าจาก SPEEDACCOUNT.COM';
$subject = "=?UTF-8?B?".base64_encode($subject)."?="; //convert subject to thai lang
// message
$message = '
<html>
<head>
  <title>หนังสือบัญชี,คู่มือเตรียมสอบ,เตรียมสอบบัญชี,เตรียมสอบta,เตรียมสอบcpa,คู่มือเตรียมสอบTA,คู่มือสอบเข้าราชการ,คู่มือเตรียมสอบCPA,ชีทเตรียมสอบ,DVDวิชาบัญชี,DVDสอบTA,Speedaccount.com</title>
</head>
<body>
  <p><font color="blue"><strong>คุณได้สั่งซื้อของจากทาง Speedaccount.com มีรายละเอียดดังนี้</strong></font></p>
  <table border="1" width="600" cellspacing="0" cellpadding="0">
    <tr>
      <th  colspan="5" align="left" bgcolor="#0066FF"><font color="#FFFFFF">เลขที่ใบสั่งซื้อ: 00111</font></th>
    </tr>
    <tr>
				  <th bgcolor="#D3EBE8">รหัสสินค้า</th>
				  <th bgcolor="#D3EBE8">ชื้อสินค้า</th>
				  <th bgcolor="#D3EBE8">ราคาต่อหน่วย</th>
				  <th bgcolor="#D3EBE8">จำนวนสั่งซื้อ</th>
				  <th bgcolor="#D3EBE8">รวม</th>
    </tr>
	 <?
				 
				function idpro($a){// function tor find idproduct in database
				include"Connections/connect.php";
				$sql="select * from product where id=$a ";
				$result=mysql_db_query($dbname,$sql);
				$data=mysql_fetch_array($result);
				$idproduct=$data[idproduct];
				return $idproduct;
					}
										 
											  for ($i=0;$i<count ($sess_id) ; $i++){
											$idproduct=$data[idproduct];
											  $total_unit=$sess_num[$i] * $sess_price [$i];
											  $total=$total+$total_unit;
											  $code=sprintf("%05d",$sess_id[$i]);	
											  $idproduct=idpro($sess_id[$i]);

			?>
<tr>
  			  <td><? echo $idproduct ?></td>
   			 <td><div align="center"><? echo $sess_name [$i]?></div></td>
  			  <td><div align="right"><? echo $sess_num[$i]?></div></td>
  			  <td><div align="right"><? echo $sess_price[$i] ?></div></td>
   			 <td><div align="right"><? echo  $total_unit ?></div></td>
  </tr>
<?
			}
?>

 <tr align="center">
  			  <td colspan="4">ค่าจัดส่ง</td>
   			 <td><? $a=50; echo $a; ?></td>
 </tr>
 <tr align="center">
  			  <td colspan="4">ราคารวมทั้งหมด&nbsp;&nbsp;</td>
   			 <td bgcolor="#FFFF99" ><font color="red"><strong><? echo "$total"; ?></strong></font>&nbsp;฿</td>
 </tr>
</table><br/>
 <font color="blue"> <strong>กรุณาชำระค้าสินค้าโดยการโอนเงินตามหมายเลขบัญชีดังนี้</strong></font><br/><br/>
<img src="http://www.speedaccount.com/images/bank-kasikorn.gif" width="36" height="36" align="absmiddle" />&nbsp;ธ.กสิกรไทย  สาขาทองหล่อ ออมทรัพย์ ชื่อบัญชี นายจิตติพงษ์ โม่งประณิตร์ หมายเลข 000000000000<br/>

<img src="http://www.speedaccount.com/images/bank-scb.gif" width="36" height="36" align="absmiddle"/>&nbsp;ธ.ไทยพาณิชย์ สาขาหัวหมาก ออมทรัพย์ ชื่อบัญชี นายจิตติพงษ์ โม่งประณิตร์ หมายเลข 000000000000

<br/><br/>
  
  ******************หากท่านชำระสินค้าแล้วกรุณาทำการยืนยันตามลิงค์นี้ <a href="http://www.google.co.th/">ยืนยันการชำระเงิน</a>******************<br/>
  <font color="red"><strong>หากมีปัญหาในการชำระเงินหรือการยืนยันการชำระเงินติดต่อได้ที่ 
  <br/></strong></font>Tel:089-673-2136
  <br/>E-mail: <a href="mailto:[email protected]">[email protected]</a><br/><br/><br/>
  <p align="center"><font color="red"><strong>ทางเราจะจัดส่งสินค้าให้ทันทีที่ตรวจสอบข้อมูลเรียบร้อย</strong></font></p>
  <br/> <font color="blue"> <strong> ขอบคุณที่ใช้บริการ</strong></font><br/>
 <strong> <a href="www.Speedaccount.com">www.Speedaccount.com</a> </strong><br/>
 <a href="http://www.speedaccount.com"><img src="http://www.speedaccount.com/images/picformailorder.jpg" width="856" height="139" /></a>
 <hr>

<p align="center"><strong> จำหน่าย </strong><br/>
 หนังสือบัญชี,คู่มือเตรียมสอบ,เตรียมสอบบัญชี,เตรียมสอบta,เตรียมสอบcpa,คู่มือเตรียมสอบTA,<br/>คู่มือสอบเข้าราชการ,คู่มือเตรียมสอบCPA,ชีทเตรียมสอบ,DVDวิชาบัญชี,DVDสอบTA
 </p>
 
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers.= 'Content-type: text/html; charset=UTF-8' . "\r\n"; 
// Additional headers
//$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
$headers .= 'From: Speedaccount.com <[email protected]>' . "\r\n";
//$headers .= 'Cc: [email protected]' . "\r\n";
//$headers .= 'Bcc: [email protected]' . "\r\n";

// Mail it
if(mail($to, $subject, $message, $headers)){
	echo "Sendmail Complease<br/>";
	echo "<a href='index.php'>home</a>";
}else{
	echo "Cannot Send mail</br>";
	echo "<a href='index.php'>home</a>";
}
?>

Date : 2010-07-09 17:13:15 By : chittipong
 

 

No. 3



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์



แทนที่ตั้งแต่ $message เลยนะ

Code (PHP)
$message = '
<html>
<head>
<title>หนังสือบัญชี,คู่มือเตรียมสอบ,เตรียมสอบบัญชี,เตรียม สอบta,เตรียมสอบcpa,คู่มือเตรียมสอบTA,คู่มือสอบเข้าราชการ,คู่มือเตรียม สอบCPA,ชีทเตรียมสอบ,DVDวิชาบัญชี,DVDสอบTA,Speedaccount.com</title>
</head>
<body>
<p><font color="blue"><strong>คุณได้สั่งซื้อของจากทาง Speedaccount.com มีรายละเอียดดังนี้</strong></font></p>
<table border="1" width="600" cellspacing="0" cellpadding="0">
<tr>
<th colspan="5" align="left" bgcolor="#0066FF"><font color="#FFFFFF">เลขที่ใบสั่งซื้อ: 00111</font></th>
</tr>
<tr>
<th bgcolor="#D3EBE8">รหัสสินค้า</th>
<th bgcolor="#D3EBE8">ชื้อสินค้า</th>
<th bgcolor="#D3EBE8">ราคาต่อหน่วย</th>
<th bgcolor="#D3EBE8">จำนวนสั่งซื้อ</th>
<th bgcolor="#D3EBE8">รวม</th>
</tr>';

function idpro($a){// function tor find idproduct in database
include"Connections/connect.php";
$sql="select * from product where id=$a ";
$result=mysql_db_query($dbname,$sql);
$data=mysql_fetch_array($result);
$idproduct=$data[idproduct];
return $idproduct;
}

for ($i=0;$i<count ($sess_id) ; $i++){
$idproduct=$data[idproduct];
$total_unit=$sess_num[$i] * $sess_price [$i];
$total=$total+$total_unit;
$code=sprintf("%05d",$sess_id[$i]);
$idproduct=idpro($sess_id[$i]);

$message .= '<tr>
<td>' . $idproduct  . '</td>
<td><div align="center">' . $sess_name [$i] . '</div></td>
<td><div align="right">' . $sess_num[$i] . '</div></td>
<td><div align="right">' . $sess_price[$i]  . '</div></td>
<td><div align="right">' . $total_unit  . '</div></td>
</tr>';
}
$a=50;
$message .= '<tr align="center">
<td colspan="4">ค่าจัดส่ง</td>
<td>' . $a . '</td>
</tr>
<tr align="center">
<td colspan="4">ราคารวมทั้งหมด&nbsp;&nbsp;</td>
<td bgcolor="#FFFF99" ><font color="red"><strong>' . $total . '</strong></font>&nbsp;฿</td>
</tr>
</table><br/>
<font color="blue"> <strong>กรุณาชำระค้าสินค้าโดยการโอนเงินตามหมายเลขบัญชีดัง นี้</strong></font><br/><br/>
<img src="http://www.speedaccount.com/images/bank-kasikorn.gif" width="36" height="36" align="absmiddle" />&nbsp;ธ.กสิกรไทย สาขาทองหล่อ ออมทรัพย์ ชื่อบัญชี นายจิตติพงษ์ โม่งประณิตร์ หมายเลข 000000000000<br/>

<img src="http://www.speedaccount.com/images/bank-scb.gif" width="36" height="36" align="absmiddle"/>&nbsp;ธ.ไทยพาณิชย์ สาขาหัวหมาก ออมทรัพย์ ชื่อบัญชี นายจิตติพงษ์ โม่งประณิตร์ หมายเลข 000000000000

<br/><br/>

******************หากท่านชำระสินค้าแล้วกรุณาทำการยืนยันตามลิงค์นี้ <a href="http://www.google.co.th/">ยืนยันการชำระเงิน</a& gt;******************<br/>
<font color="red"><strong>หากมีปัญหาในการชำระเงินหรือการยืนยันการชำระ เงินติดต่อได้ที่
<br/></strong></font>Tel:089-673-2136
<br/>E-mail: <a href="mailto:[email protected]">[email protected]</a><br/><br/><br/>
<p align="center"><font color="red"><strong>ทางเราจะจัดส่งสินค้าให้ทันทีที่ตรวจสอบ ข้อมูลเรียบร้อย</strong></font></p>
<br/> <font color="blue"> <strong> ขอบคุณที่ใช้บริการ</strong></font><br/>
<strong> <a href="www.Speedaccount.com">www.Speedaccount.com</a> </strong><br/>
<a href="http://www.speedaccount.com"><img src="http://www.speedaccount.com/images/picformailorder.jpg" width="856" height="139" /></a>
<hr>

<p align="center"><strong> จำหน่าย </strong><br/>
หนังสือบัญชี,คู่มือเตรียมสอบ,เตรียมสอบบัญชี,เตรียมสอบta,เตรียมสอบcpa,คู่ มือเตรียมสอบTA,<br/>คู่มือสอบเข้าราชการ,คู่มือเตรียมสอบCPA,ชีท เตรียมสอบ,DVDวิชาบัญชี,DVDสอบTA
</p>

</body>
</html>
';

Date : 2010-07-09 21:26:34 By : plakrim
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เขียนสคริปส่งเมล์แต่ไม่สามารถแสดงค่าที่อยู่ในตัวแปรที่ส่งไปใครรู้บ้างครับพี่น้องครับสงเคราะห์ผมที
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่