如何在输入字段中添加id's


how to append id's with the input field?

如何在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作为输入字段的值。