i have a form and I repeate the same fields because i don't the user if he has more than one Item to send the first Item and he do agin and agin i want it from the first time to add the all items he has, so i put the same Required fields more than once.
<form>
<select name="items[]">
<option value="clothes">Clothes</option>
<option value="shoes">Shoes</option>
</select>
<input type="text" name="color[]" />
<select name="items[]">
<option value="clothes">Clothes</option>
<option value="shoes">Shoes</option>
</select>
<input type="text" name="color[]" />
</form>
and I know how to get just one field like this : name="color[]" I can get the result with:
while(list($key,$value) = each($_POST['color'])){
if(!empty($value)){
echo $_POST['color'][$key];
echo "<br />" ;
}}
but now i want to get all values "select items and color"
i made this code here and I got all the results But it is not linked to each other!!!
like this: clothes shoes red blue
i want it like this: clothes-red shoes-blue
this is the code which i made But I'm not satisfied
while(list($key,$value) = each($_POST['input'])){
if(!empty($value)){
echo $_POST['input'][$key];
echo "<br />" ;
}}
while(list($key,$value) = each($_POST['items'])){
if(!empty($value)){
echo $_POST['items'][$key];
echo "<br />" ;
}}
can anybody help me please :)
thank you,