Quote:ไม่มีรายละเอียดอะไรให้ดูเลยเหรอครับ error message รูป หรืออะไรก็ได้ที่บอกได้ว่ามันมีปัญหาอ่ะ ไม่งั้นก็ไม่รู้จะช่วยไง
<?php session_start(); $id_prd=$_GET[id_prd]; session_register("sess_id"); session_register("sess_photo_prd"); session_register("sess_name"); session_register("sess_price"); session_register("sess_num"); if (count ($sess_id)=="0") { $check=1; } else if (!in_array($id_prd, $sess_id)) { $check=1; } if ($check==1) { include "include/connect.php"; $sql="select * from tb_product where id_prd='$id_prd' "; $result=mysql_db_query($dbname,$sql); $rs=mysql_fetch_array($result); $sess_id[ ]=$rs[id_prd]; $sess_name[]=$rs[name_prd]; $sess_price[]=$rs[price_prd]; $sess_photo_prd[]=$rs[photo_prd]; $sess_num[]=1; } echo "<script>window.location=\"basket.php\"</script>"; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php session_start(); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style3 { font-family: Angsana New,CordiaUPC,Tahoma,AngsanaUPC, BrowalliaUPC, CordiaUPC; font-size:18px; font-weight:bold; color: #ff0000; } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } --> </style></head> <body> <table width="1000" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="23" colspan="2" align="left" valign="top"><?php include ('search.php'); ?></td> </tr> <tr> <td width="140" height="49" align="left" valign="top"><table width="140" border="0" cellpadding="0" cellspacing="0" bgcolor="#001e64"> <tr> <td width="186" height="49" align="left" valign="top"><?php include('type_list.php'); ?> </td> </tr> </table></td> <td width="860" valign="top"><table width="850" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="880" height="24" align="center" valign="middle"bgcolor="#001e64"> <div align="center"><font color="#ffffff" size="2" style="font-family:Arial, Helvetica, sans-serif">ตะกร้าสินค้า</font></div></td> </tr> <tr> <td height="4" bgcolor="#001e64"></td> </tr> <tr> <td><table width="698" border="0"> <tr> <td width="692" height="200" valign="top"> <?php include "include/connect.php"; if (count($sess_id)==0) { echo "ยังไม่มีสินค้าอยู่ในตะกร้าครับ<br>"; }else{ ?> <form method="post" action="basket_cal.php"> <table width="100%" border="1"> <tr bgcolor="e8e8e8"> <td width="6%"><center><b>ลบ</b></center></td> <td width="60%"><center><b>รูป</b></center></td> <td width="60%"><center><b>ชื่อสินค้า</b></center></td> <td width="12%"><center><b>จำนวน</b></center></td> <td width="10%"><center><b>ราคา</b></center></td> <td width="12%"><center><b>รวม</b></center></td> </tr> <?php for ($i=0;$i<count ($sess_id);$i++) { $total_unit=$sess_num[$i] * $sess_price[$i]; $total=$total+$total_unit; echo" <tr> <td><center> <input type='checkbox' name='prd_del[]' value='$sess_id[$i]'> </center></td> <td><img src='admin/photo/$sess_photo_prd[$i]' border='0' width='100' ></td> <td>$sess_name[$i]</td> <td><center> <input type='text' name='prd_num[]' value='$sess_num[$i]' size='4'> </center></td> <td><center>$sess_price[$i]</center></td> <td><center>$total_unit</center></td> </tr>"; } ?> </table> <?php $num =0; for ($i=0;$i<count ($sess_id);$i++) { $num++; } echo" สินค้าในตะกร้า "; echo" $num"; echo" รายการ"; ?> <p align="right"> <? echo "จำนวนเงินทั้งหมด $total บาท"; ?><br /><br /> <a href="Main_Frame.php" target="_self"><<กลับไปเลือกสินค้าใหม</a>่ <input type="submit" name="calculate" value="คำนวณใหม่"> <input type="submit" name="complete" value="สั่งซื้อสินค้า" /> </p> </form> <?php } ?></td> </tr> </table></td> </tr> </table></td> </tr> </table> <p> </p> </body> </html>
<?php session_start(); if (count($prd_del)==0) { $prd_del=array(); } for ($i=0;$i<count($sess_id);$i++) { if (!in_array($sess_id[$i],$prd_del)) { $temp_id[]=$sess_id[$i]; $temp_photo_prd[]=$sess_photo_prd[$i]; $temp_name[]=$sess_name[$i]; $temp_price[]=$sess_price[$i]; $temp_num[]=$prd_num[$i]; } } $sess_id=$temp_id; $sess_photo_prd=$temp_photo_prd; $sess_name=$temp_name; $sess_price=$temp_price; $sess_num=$temp_num; if ($calculate) { header("Location: basket.php"); }else if ($complete) { header("Location: prd_order.php"); } ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Quote:ลองทำตามคำแนะนำในนี้ดูครับ PHP Register Global On/Off
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง