今天用php嵌入html写了一段购物车更新的程序,结果发现无法获取表单里面的值,导致无法更新
<form method="post" action="updatecart.php" id="update_cart" name="update_cart">
<table width="600" border="1" align="center">
<tr>
<td width="400" >My Cart </td>


  </tr>
</table>
<table width="600" border="1" align="center">
<tr>
<td width="50">Qty</td>
<td width="20">Product_id</td>
<td width="240">Description</td>
<td width="100">Price_et</td>
<td width="100">Price</td>
</tr>
<?php 
//====================================
if($numrows<=0){
    echo "购物车中暂时没有此商品";
exit();
}else {
 
  while($resultcart= mysql_fetch_array($resulta)){
  
$sqlb="select * from products where product_id='$resultcart[product_id]'"; 
$resultb=mysql_query($sqlb);
$resultproduct=mysql_fetch_array($resultb); // elseif($_POST[['product_id']==$resultcart['product_id']){
//while($resultcart=mysql_fetch_array($resulta)){
$add=array();
$addlist=array();
$add['number']=$resultcart['number'];
$add['product_id']=$resultcart['product_id'];
$add['product_name']=$resultproduct['product_name'];
$add['product_mprice']=$resultproduct['product_mprice'];
$add['product_price']=$resultproduct['product_price'];
$addlist[]=$add;
$total+=$add['product_price']*$add['number'];
foreach($addlist as $key=>$value){

//===========================================

?>
<tr>
<td><input type="text" name="resetnumber" id="resetnumber" value="<?php echo $add['number'];?>" size="5" /></td>
<td><?php echo $add['product_id'];?></td>
<td><?php echo $add['product_name'];?></td>
<td>$<?php echo $add['product_mprice'];?></td>
<td>$<?php echo $add['product_price'];?></td>

<td width="70"><a href="delete.php?product_id=<?php echo $add['product_id'];?>"><img src="../images/cart/btn_remove.gif" width="70"  align="right"/> </a></td>
</tr>
<?php
//exit();
}
}
}
?>
    
</table>
<table  width="600" border="1" align="center">
<tr>
<td align="right">Total Price:$<?php echo $total;?></td>
</tr>
</table>
<table  width="600" border="1" align="center">
<tr>
<td width="400"></td>
<td><a href="../products/Porducts.html"><img src="../images/cart/btn_continue.gif" width="100" height="35" border="0" /></a></td>
<td><a href="updatecart.php"><img src="../images/cart/btn_recalculate.gif" width="100" height="35" border="0"/></a></td>