如何在PHP中添加输入字段并在另一页上发送id ?
<input type="text" size="3" name="new_quantity[]" value="<?php echo $product_quantity; ?>" />
帮忙吗? ?
试试这个:
<input type="text" size="3" name="new_quantity[<?php echo $product_id; ?>]" value="<?php echo $product_quantity; ?>" />
changed: name="new_quantity[<?php echo $product_id; ?>]"
在另一页
print_r($_REQUEST['new_quantity']);
您可以看到product_id
作为输入字段的键,value
作为输入字段的值。