I have created a multipage form which collects data input by the user before and is then sent by email.
I have created a table that the user has to fill in an ammount for each item. They user doesn't have to fill everything in only the items that apply.
This is a sample of the table.
It haa a text input which holds the amount and a hidden value that holds the description so they can he eched out next to each other later for example "Item 1: 100"
<table>
<tr>
<th>Description</td>
<th>Amount</td>
<th>Description</td>
<th>Amount</td>
</tr>
<tr>
<td>Item 1</td>
<td><input type="text" name="amount[]">
<input type="hidden" name="description[]" value="Item 1">
</td>
<td>Item 2</td>
<td><input type="text" name="amount[]">
<input type="hidden" name="description[]" value="Item 2">
</td>
</tr>
<tr>
<td>Item 3</td>
<td><input type="text" name="amount[]">
<input type="hidden" name="description[]" value="Item 3">
</td>
<td>Item 4</td>
<td><input type="text" name="amount[]">
<input type="hidden" name="description[]" value="Item 4">
</td>
</tr>
I want to loop out this data using a while loop however only one value is being echoed not both.
while(list(, $description) = each($_POST['description']) && list(, $amount) = each($_POST['amount'])){
echo $description ." " . amount . " ";
}