echo "<td><input type=\"checkbox\" name=\"ProductKey[]\" value=\"".$Key."\"/></td>";
foreach ($_POST['ProductKey'] as $Key){ .... }
<head> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"></link> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.min.css"></link> <link rel="stylesheet" type="text/css" href="move.css"></link> <!--------------------------------------------------------------------------------------> <meta name="viewport" content="width=device-width, initial=scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <script src="movescroll.js"></script><!-- เคลื่อนที่ตาม scrollbar--> </div> <script src ="multiButton.js"></script> // อันนี้เป็น javascript ที่ใช้ในจัดการ เปลี่ยน target เมื่อคลิกแต่ละปุ่ม <? echo "<p><center><SPAN style=\"BACKGROUND-COLOR: #fff000\"><strong>น้อมจิตร1 </strong></span></center> </p>"; $hostname = "localhost"; $user = "************"; $password = "**********"; $dbname = "************"; //กำหนดฐานข้อมูล $tblname = "Product"; //กำหนดตาราง mysql_connect($hostname, $user, $password) or die("ติดต่อฐานข้อมูลไม่ได้"); mysql_select_db($dbname) or die("เลือกฐานข้อมูลไม่ได้"); $sql = "select * from $tblname where Customer = 'ram21' order by ProductID,Colour,Size ASC "; //คำสั่ง SQL เพื่อการแสดงผล $result = mysql_query($sql); if(!$result){ echo "เกิดข้อผิดพลาดในการอ่านข้อมูล"; } else if(mysql_num_rows($result) == 0){ echo "ไม่มีข้อมูลในตาราง"; } else{ echo "<form name='myform' method='POST'>";//<!--------------------------------------------------------------------------------------> echo "<center><table border=1 cellpadding=3 background=\"Table.jpg\">"; echo "<td>การเลือก</td><td>รหัสสินค้า</td><td>ไชต์</td><td>สี</td><td>ราคา</td><td>เหลือ</td><td>ร้านค้า</td>"; while ($data = mysql_fetch_array($result)) //วนลูปแสดงผล { echo "<tr>"; $ProductID = $data['ProductID']; $Size = $data['Size']; //กำหนดค่าตัวแปล $Colour = $data['Colour']; $Price = $data['Price']; $Quantity = $data['Quantity']; $Customer = $data['Customer']; $Key = $data['ProductKey']; ?><td><input type= "checkbox" name= "ProductKey[]" value= "<?=$Key?>" /></td> <? echo "<input type='hidden' name='U' value='ram21Part'>"; echo "<td>{$ProductID}</td><td>{$Size}</td><td>{$Colour}</td><td>{$Price}</td><td>{$Quantity}</td><td>{$Customer}</td>"; echo "<td><a href=\"editPage.php?ProductID=".$ProductID."&Size=".$Size."&Colour=".$Colour."&Quantity=".$Quantity."&Price=".$Price."&Customer=".$Customer."&Key=".$Key."\">แก้ไขสินค้า</a></td>"; echo "</tr>"; $i++; } echo "</table></center>"; } echo "<hr>"; ?> <div id="topbar" class ="well"> </br></br> <center> การกระทำ</br> <input type='button' id='edit' onclick="OnButtonEdit();" class = "btn btn-success" value='เพิ่มจำนวน'></br></br> <input type='button' id='delete' onclick="OnButtonDelete();" class = "btn btn-warning" value='ลดจำนวน'></br></br> <input type='button' id='delete' onclick="OnButtonRemove();" class = "btn btn-danger" value='ลบสินค้า'></br></br> <input type='button' id='delete' onclick="OnButtonProductbackquery();" class = "btn btn-info" value='ส่งสินค้ากลับ'></br> </center> </div> <? echo "</form>"; ?>
function OnButtonEdit(){ document.myform.action = "edit.php"; document.myform.target = "_self"; document.myform.submit(); return true; } function OnButtonDelete() { document.myform.action = "delete.php"; document.myform.target = "_self"; document.myform.submit(); return true; } function OnButtonRemove(){ document.myform.action = "remove.php"; document.myform.target = "_self"; document.myform.submit(); return true; } function OnButtonProductbackquery(){ document.myform.action = "productBackQuery.php"; document.myform.target = "_self"; document.myform.submit(); return true; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง