<form name="cart_quantity" action="http://www.example.com/product_info.php?products_id=101&action=add_mult" method="post"><div class="simplebox5">
<table width="100%" border="0" cellspacing="0" cellpadding="2" align="left" class="mytable">
<tbody><tr>
<td class="maintop" colspan="4">
<a title="Customer Rewards and Points" href="my_points_help.php">Customer Reward Points</a> are available for this item. Reward Points are points that YOU earn. <a title="Customer Rewards and Points" href="my_points_help.php">Details.</a>
</td>
</tr>
<tr>
<td class="mains" colspan="4"><img src="images/icons/star.png" height="9" width="9" border="0" alt="Products name"> Name: Blue Lotus</td>
</tr>
<tr>
<td class="mains" align="left" colspan="4"><img src="images/icons/star.png" height="9" width="9" border="0" alt="In stock"> In Stock!</td>
</tr>
<tr>
<td class="mains" align="left" width="68%"><img src="images/icons/star.png" height="9" width="9" border="0" alt="Options"> Options </td>
<td class="mains" align="right" width="12%"> Price </td>
<td class="mains" width="15%" align="center">
<b><a href="my_points_help.php">Reward<br>Points<br>Earned</a></b>
</td>
<td class="mains" align="center" width="5%">Quan-<br>tity</td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
One Seed Pack<input type="hidden" name="a[]" value="25"><input type="text" name="a1" value="25" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$5.00</td>
<td class="mains" width="15%" align="center">
5 </td>
<td class="mains" align="center" width="5%"><span style="color: #FF0000"><strong>Out<br>of<br>Stock</strong></span><input type="hidden" name="quantity" value="0"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
28 Grams Stamens<input type="hidden" name="a[]" value="879"><input type="text" name="a1" value="879" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$19.00</td>
<td class="mains" width="15%" align="center">
19 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
114 Grams Stamens<input type="hidden" name="a[]" value="880"><input type="text" name="a1" value="880" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$65.00</td>
<td class="mains" width="15%" align="center">
65 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
1 Gram 20x extract<input type="hidden" name="a[]" value="236"><input type="text" name="a1" value="236" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$6.00</td>
<td class="mains" width="15%" align="center">
6 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
3 Grams 20x Extract Powder<input type="hidden" name="a[]" value="267"><input type="text" name="a1" value="267" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$15.00</td>
<td class="mains" width="15%" align="center">
15 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
<b><span style="color: #FF0000">SALE!</span></b> 1 Kilo (2.2 pounds) Dried Flowers<input type="hidden" name="a[]" value="925"><input type="text" name="a1" value="925" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$125.00</td>
<td class="mains" width="15%" align="center">
0 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
28 Grams Dried Flowers<input type="hidden" name="a[]" value="302"><input type="text" name="a1" value="302" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$10.00</td>
<td class="mains" width="15%" align="center">
10 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
114 Grams Dried Flowers<input type="hidden" name="a[]" value="185"><input type="text" name="a1" value="185" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$35.00</td>
<td class="mains" width="15%" align="center">
35 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="mains" align="left" width="68%">
454 grams (1 pound) Dried Flowers<input type="hidden" name="a[]" value="989"><input type="text" name="a1" value="989" style="display:none"><input type="hidden" name="b[]" value="6"><input type="text" name="b1" value="6" style="display:none"> </td>
<td class="mains" align="right" width="12%">$100.00</td>
<td class="mains" width="15%" align="center">
100 </td>
<td class="mains" align="center" width="5%"><input type="text" name="quantity[]" value="0" size="3"></td>
</tr>
<tr>
<td class="main" align="center" colspan="4"><br><input type="hidden" name="products_id" value="101"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart "></td>
</tr>
</tbody></table>
</div>
</form>
当我的表单提交动作执行但表单的帖子值没有得到?任何人帮助我
我尝试了所有 $ _ REQUEST 和 $ _ POST 所有仅打印 数组([products_id] =&gt; 101 [action] =&gt; add_mult)
没有人得到a[],b[],a1,b1
vales为什么?
帮帮我
答案 0 :(得分:0)
您已将两次 a1 名称定义为唯一,或者您可以定义 a1 [] ,
另一件事是你已经将 a [] 留空了,应该是这样的 a [&#39; value&#39;]
答案 1 :(得分:0)
它对我有用。让我们测试一下,在操作页面product_info.php上添加此代码:
<?php
print_r($_POST);
?>
启动并将第一页提交至product_info.php,以下输出应显示在product_info.php上:
Array ( [a] => Array ( [0] => 25 [1] => 879 [2] => 880 [3] => 236 [4] => 267 [5] => 925 [6] => 302 [7] => 185 [8] => 989 ) [a1] => 989 [b] => Array ( [0] => 6 [1] => 6 [2] => 6 [3] => 6 [4] => 6 [5] => 6 [6] => 6 [7] => 6 [8] => 6 ) [b1] => 6 [quantity] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 ) [products_id] => 101 [x] => 31 [y] => 11 )