<?php session_start(); ?> <html> <head> <title>ThaiCreate.Com</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <? mysql_connect("localhost","root","usbw"); mysql_select_db("peet"); ?> <table width="400" border="1"> <tr> <td width="101">ProductID</td> <td width="82">ProductName</td> <td width="82">Price</td> <td width="79">Qty</td> <td width="79">Total</td> <td width="10">Del</td> </tr> <? $Total = 0; $SumTotal = 0; for($i=0;$i<=(int)$_SESSION["intLine"];$i++) { if($_SESSION["strProductID"][$i] != "") { $strSQL = "SELECT * FROM product WHERE ProductID = '".$_SESSION["strProductID"][$i]."' "; $objQuery = mysql_query($strSQL) or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); $Total = $_SESSION["strQty"][$i] * $objResult["Price"]; $SumTotal = $SumTotal + $Total; ?> <tr> <td><?=$_SESSION["strProductID"][$i];?></td> <td><?=$objResult["ProductName"];?></td> <td><?=$objResult["Price"];?></td> <td><?=$_SESSION["strQty"][$i];?></td> <td><?=number_format($Total,2);?></td> <td><a href="delete.php?Line=<?=$i;?>">x</a></td> </tr> <? } } ?> </table> Sum Total <?=number_format($SumTotal,2);?> <br><br><a href="product.php">Go to Product</a> <? if($SumTotal > 0) { ?> | <a href="checkout.php">CheckOut</a> <? } ?> <? mysql_close(); ?> </body> </html>
var_dump($_SESSION["strProductID"][$i])
Quote:<?
Quote:<?=$_SESSION["strProductID"][$i];?
<?php session_start(); ?> <html> <head> <title>puttipong</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <? mysql_connect("localhost","root","usbw"); mysql_select_db("peet"); ?> <table width="400" border="1"> <tr> <td width="101">ProductID</td> <td width="82">ProductName</td> <td width="82">Price</td> <td width="79">Qty</td> <td width="79">Total</td> <td width="10">Del</td> </tr> <? $Total = 0; $SumTotal = 0; for($i=0;$i<=(int)$_SESSION["intLine"];$i++) { if($_SESSION["strProductID"][$i] != "") { $strSQL = "SELECT * FROM product WHERE ProductID = '".$_SESSION["strProductID"][$i]."' "; $objQuery = mysql_query($strSQL) or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); $Total = $_SESSION["strQty"][$i] * $objResult["Price"]; $SumTotal = $SumTotal + $Total; ?> <tr> <td><?php echo $_SESSION["strProductID"][$i];?></td> <td><?php echo $objResult["ProductName"];?></td> <td><?php echo $objResult["Price"];?></td> <td><?php echo $_SESSION["strQty"][$i];?></td> <td><?php echo number_format($Total,2);?></td> <td><a href="delete.php?Line=<?=$i;?>">x</a></td> </tr> <? } } ?> </table> Sum Total <?=number_format($SumTotal,2);?> <br><br><a href="product.php">Go to Product</a> <? if($SumTotal > 0) { ?> | <a href="checkout.php">CheckOut</a> <? } ?> <? mysql_close(); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง