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 : 049987

Guest




ใน appserv
app
ใน host ที่มีปัญหา
host
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
session_start();
$muser=$_SESSION['user1'];
$s_pay=$_GET['s_pay'];
if($s_pay=='tfcredit')

{
$s_pay1="";
}
else
{
$s_pay1="โอนผ่านธนาคาร";
}
//ส่วนที่ 1 ผู้รับ
//ถ้าเลือกที่อยู่ตามผู้สั่ง ก็ต้องดึงจาก Base
//แต่ถ้าเลือกผู้รับใหม่ ต้องเอาจาก Session
//กรณีที่ 1


//host
$host="localhost";
$hostuser="345730";
$pass="public";
$connect=mysql_connect($host="localhost",$hostuser="345730",$pass="84267139") or die("ไม่สามารถติดต่อ host ได้");
//ติดต่อdatabase
$host="localhost";
$database="345730";
mysql_select_db($database,$connect) or die("ไม่สามารถติดต่อ database ได้");

	//change ภาษา
	mysql_query("SET NAMES 'tis620'");
if($s_recieve=="ที่อยู่ผู้สั่งซื้อ")
{
	
	
	//คำสั่ง
	$sql="select * from member where mem_user='$muser'";
	$runsql=mysql_query($sql) or die("ไม่สามารถ Run SQL ได้");
	$row=mysql_fetch_array($runsql);
	$mname=$row['mem_user'];
	$madd=$row['mem_add'];
	$mtel=$row['mem_tel'];
	}
else
{
	$mname=$s_rname;
	$madd=$s_radd;
	$mtel=$s_rtel;
}

	$sql1="select * from send where sendname='$s_send'";
	$runsql1=mysql_query($sql1) or die("ไม่สามารถ Run SQL1 ได้");
	$row1=mysql_fetch_array($runsql1);
	$sprice=$row1['sendprice'];
	$_SESSION['send_id']=$row1['sendid'];
?>

<br />
              <br /></td>
          </tr>
        </table></p>
              
           
              </td>
            <td width="76%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <td> 
                  <form name="order" method="post" action="confirm1.php">
<input name=s_pay1 type="hidden" value="<?php echo $s_pay1 ?>" />
<center>
  <p>&nbsp;</p>
  <p><br />
  </p>
  <table border=3 bordercolor="#FF9999" class="table">

<tr>
	<th><center>ลำดับ</center></th>
	<th><center>รหัส</center></th>
	<th><center>ชื่อ</center></th>
	<th><center>ราคา</center></th>
	<th><center>จำนวน</center></th>
	<th><center>รวม</center></th>
</tr>
<?php
$total=0;
	for($i=0;$i<count($s_id);$i++)
	{
	$no+=1;
	//หาผลรวมในแต่ละรายการ
	$sum=$s_num[$i]*$s_price[$i];
	//หาผลรวมทั้งหมด โดยเอาเเต่ละรายการมาพวก ทบไปเรื่อยๆ
	$total+=$sum;
?>
<tr>
	<td><center><?php echo $no; ?></center></td>
	<td><center><?php echo $s_id[$i];?></center></td>
	<td><center><?php echo $s_name[$i];?></center></td>
	<td><center><?php echo $s_price[$i];?></center></td>
	<td><center><?php echo $s_num[$i]; ?></center></td>
	<td><center><?php echo $sum;?></center></td>
</tr>
<?php  } ?>

<tr>
	<td colspan=4><center></center></td>
	<th><center>รวม</center></th>
	<td><?php echo $total;?></td>	
</tr>
<tr>
	<td colspan=4><center></center></td>
	<th><center>ค่าส่ง</center></th>
	<td><?php echo $sprice ;?></td>
</tr>
<?php
$net =$total+$sprice;
$_SESSION['nettotal']=$net;
?>
<tr>
	<td colspan=4><center></center></td>
	<th><center>รวมทั้งหมด</center></th>
	<td><?php echo $net ;?></td>
</tr>
</table>
  <br />
</center>
<center>
<table width="250" height="109" border="1" align="center" bordercolor="#FF6666">
<tr>

	<td width="93"><div align="left">วิธีการชำระเงิน</div></td>
	<td width="145"><?php echo $s_pay1; ?>
	  <div align="left"></div></td>
</tr>
<tr>
	<td><div align="left">ชื่อ-สกุล</div></td>
	<td><?php echo $mname; ?>
	  <div align="left"></div></td>
</tr>
<tr>
	<td><div align="left">ที่อยู่</div></td>
	<td><?php echo $madd; ?>
	  <div align="left"></div></td>
</tr>
<tr>
	<td><div align="left">เบอร์โทร</div></td>
	<td><?php echo $mtel; ?></td>
</tr>
</table>
</center>
<center>
<table>
<tr>
<td><input type=submit name=confirm value="ยืนยันการสั่งซื้อ"></td>
<center>
  <a href="index.php">สั่งซื้อเพิ่ม</a>
</center>
</tr>
</table>
</center>
</form>
</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td valign="bottom" background="Drag to a file to choose it." class="table"><img src="images/footer.gif" width="990" height="80" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</center>

<map name="Map" id="Map">
  <area shape="poly" coords="823,170,827,168,832,166,836,165,842,163,847,162,852,160,856,159,860,159,912,158,916,160,923,161,930,164,939,167,947,172,951,175,951,181,947,186,942,189,929,195,915,197,900,198,887,198,867,198,855,197,841,195,825,189,818,181,818,174" href="postque.php" />
  <area shape="poly" coords="679,172,683,170,688,168,692,167,698,165,703,164,708,162,712,161,716,161,768,160,772,162,779,163,786,166,795,169,803,174,807,177,807,183,803,188,798,191,785,197,771,199,756,200,743,200,723,200,711,199,697,197,681,191,674,183,674,176" href="contact.php" />
  <area shape="poly" coords="539,171,543,169,548,167,552,166,558,164,563,163,568,161,572,160,576,160,628,159,632,161,639,162,646,165,655,168,663,173,667,176,667,182,663,187,658,190,645,196,631,198,616,199,603,199,583,199,571,198,557,196,541,190,534,182,534,175" href="how-to-pay.php" />
  <area shape="poly" coords="395,171,399,169,404,167,408,166,414,164,419,163,424,161,428,160,432,160,484,159,488,161,495,162,502,165,511,168,519,173,523,176,523,182,519,187,514,190,501,196,487,198,472,199,459,199,439,199,427,198,413,196,397,190,390,182,390,175" href="how-to-buy.php" />
  <area shape="poly" coords="246,174" href="#" />
<area shape="poly" coords="244,176" href="#" /><area shape="poly" coords="245,175" href="#" /><area shape="poly" coords="249,170,253,168,258,166,262,165,268,163,273,162,278,160,282,159,286,159,338,158,342,160,349,161,356,164,365,167,373,172,377,175,377,181,373,186,368,189,355,195,341,197,326,198,313,198,293,198,281,197,267,195,251,189,244,181,244,174" href="index.php" />
</map>
</body>




Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-10-09 23:05:26 By : aksang View : 874 Reply : 3
 

 

No. 1



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



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

Code (PHP)
	//คำสั่ง
	$sql="select * from member where mem_user='$muser'";
	$runsql=mysql_query($sql) or die("ไม่สามารถ Run SQL ได้");
	$row=mysql_fetch_array($runsql);
	$mname=$row['mem_user'];
	$madd=$row['mem_add'];
	$mtel=$row['mem_tel'];
	}
else
{
	$mname=$s_rname;
	$madd=$s_radd;
	$mtel=$s_rtel;
}

	$sql1="select * from send where sendname='$s_send'";
	$runsql1=mysql_query($sql1) or die("ไม่สามารถ Run SQL1 ได้");
	$row1=mysql_fetch_array($runsql1);
	$sprice=$row1['sendprice'];
	$_SESSION['send_id']=$row1['sendid'];
?>


คิดว่าน่าจะส่วนนี้นะครับ

1. $sql="select * from member where mem_user='$muser'";
2. $sql1="select * from send where sendname='$s_send'";

ตัวแปร $muser มาจากไหนอ่ะครับ ถ้าส่งมาจากอีกฟอร์มควรจะใช้ $_POST['value'] แทนนะครับ

แล้วก็ $s_send ก็เช่นเดียวกันครับ

หรือถ้าเก็บในรูปของ SESSION ก็ใช้ค่า SESSION มาใช้เลยครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-10-10 02:38:27 By : wimass
 


 

No. 2

Guest


เก็บแบบ SESSION ใช้ค่าตาม SESSION แล้วแต่ทำไมยังไม่ได้ครับ ช่วยชี้ทางให้ด้วย
Code (PHP)
<?php
session_start();
$muser=$_SESSION['user1'];

//ส่วนที่ 1 ผู้รับ
//ถ้าเลือกที่อยู่ตามผู้สั่ง ก็ต้องดึงจาก Base
//แต่ถ้าเลือกผู้รับใหม่ ต้องเอาจาก Session
//กรณีที่ 1


	//host
	$host="localhost";
	$hostuser="345730";
	$pass="public";
	$connect=mysql_connect($host="localhost",$hostuser="345730",$pass="84267139") or die("ไม่สามารถติดต่อ host ได้");
	//ติดต่อdatabase
	$host="localhost";
	$database="345730";
	mysql_select_db($database,$connect) or die("ไม่สามารถติดต่อ database ได้");

	//change ภาษา
	mysql_query("SET NAMES 'tis620'");
if($s_recieve=="ที่อยู่ผู้สั่งซื้อ")
{
	
	
	//คำสั่ง
	$sql="select * from member where mem_user='$muser'";
	$runsql=mysql_query($sql) or die("ไม่สามารถ Run SQL ได้");
	$row=mysql_fetch_array($runsql);
	$mname=$row['mem_user'];
	$madd=$row['mem_add'];
	$mtel=$row['mem_tel'];
	}
else
{
	$mname=$s_rname;
	$madd=$s_radd;
	$mtel=$s_rtel;
}

	$sql1="select * from send where sendname='$s_send'";
	$runsql1=mysql_query($sql1) or die("ไม่สามารถ Run SQL1 ได้");
	$row1=mysql_fetch_array($runsql1);
	$sprice=$row1['sendprice'];
	$_SESSION['send_id']=$row1['sendid'];
?>

<html>
<head>
<title>confirmorder</title>
<body>
<form name="order" method="post" action="confirm1.php">
<center><table border=1>

<tr>
	<th><center>ลำดับ</center></th>
	<th><center>รหัส</center></th>
	<th><center>ชื่อ</center></th>
	<th><center>ราคา</center></th>
	<th><center>จำนวน</center></th>
	<th><center>รวม</center></th>
	
</tr>
<?php
$total=0;
	for($i=0;$i<count($s_id);$i++)
	{
	$no+=1;
	//หาผลรวมในแต่ละรายการ
	$sum=$s_num[$i]*$s_price[$i];
	//หาผลรวมทั้งหมด โดยเอาเเต่ละรายการมาพวก ทบไปเรื่อยๆ
	$total+=$sum;
?>
<tr>
	<td><center><?php echo $no; ?></center></td>
	<td><center><?php echo $s_id[$i];?></center></td>
	<td><center><?php echo $s_name[$i];?></center></td>
	<td><center><?php echo $s_price[$i];?></center></td>
	<td><center><input type=text name="txtnum[]"  value ="<?php echo $s_num[$i]; ?>"size=7></center></td>
	<td><center><?php echo $sum;?></center></td>
</tr>
<?php  }  ?>

<tr>
	<td colspan=4><center></center></td>
	<th><center>รวม</center></th>
	<td><?php echo $total;?></td>	
</tr>
<tr>
	<td colspan=4><center></center></td>
	<th><center>ค่าส่ง</center></th>
	<td><?php echo $sprice ;?></td>
	
</tr>
<?php
$net =$total+$sprice;
$_SESSION['nettotal']=$net;
?>
<tr>
	<td colspan=4><center></center></td>
	<th><center>รวมทั้งหมด</center></th>
	<td><?php echo $net ;?></td>
</tr>
</table>
</center>
<center>
<table>
<tr>
	<td>ชื่อ-สกุล</td>
	<td><input type=text name=txtrname size=30 value="<?php echo $mname; ?>"></td>
</tr>
<tr>
	<td>ที่อยู่</td>
	<td><input type=text name=txtradd size=30 value="<?php echo $madd; ?>"></td>
</tr>
<tr>
	<td>เบอร์โทร</td>
	<td><input type=text name=txtrtel size=30 value="<?php echo $mtel; ?>"></td>
</tr>
</table>
</center>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-10-10 13:22:40 By : aksang
 

 

No. 3



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



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

ที่ดูนะครับตอนนี้ยังเก็บแค่ session อันเดียวเองครับ

$muser=$_SESSION['user1'];

เก็บแต่อันนี้อ่ะครับ คือเก็บค่า user1 เองครับ ต้องสร้าง session มาก่อน

ตัวอย่างง่ายๆเลยนะครับ

เช่น txt1 กรอก username ก็กำหนดไปว่า $_SESSION['username'] = $_POST['txt1'];

อะไรประมาณนี้ครับ ก็คือว่าหากกรอกข้อมูลใน textbox นั้นจะให้ไปเก็บไว้ในรูปแบบ SESSION แต่อย่าลืมเวลาใช้เสร็จอย่าลืม เคลีย session ด้วยครับ

ปล. มือใหม่อยู่นะครับ ยังไงลองดูท่านเทพๆมาให้คำแนะนำอีกทีครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-10-10 15:41:34 By : wimass
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 01
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 อัตราราคา คลิกที่นี่