Hi please be tame with me i'm new to php
So now i'll tell you the problem.
This has multiple selection checkboxes form, so person could check up to 9 checkboxes in color section, and different amounts of checkboxes in each sections.
don't know if "(list" is the way to be going as theres many more _POST to be added after the "||"
i would like it for each checkbox checked as $val the same $v should be put at end of each $val checked. hope you understand?
THE FORM
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body onload="document.forms['Form1'].reset()">
<form action="phonefinder.php" name="Form1" method=POST>
<table>
<tr class="pfinderhead"><td colspan="3"><b>Screen Size:</b></td></tr>
<tr><td style="width:35%;">128x160: <input type="checkbox" value="first" name="screen[]"></td><td style="width:30%;">176x220: <input type="checkbox" value="second" name="screen[]"></td><td style="width:35%;">240x320: <input type="checkbox" value="third" name="screen[]"></td></tr><tr><td style="width:35%;">Larger: <input type="checkbox" value="fourth" name="screen[]"></td><td style="width:35%;">Any: <input type="checkbox" value="fifth" name="screen[]"></td><td style="width:30%;">Touch: <input type="checkbox" value="sixth" name="screen[]"></td></tr>
</table>
<table>
<tr class="pfinderhead"><td colspan="3"><b>Colour:</b></td></tr>
<tr><td style="width:35%;">Black: <input type="checkbox" value="black" name="colour[]"></td><td style="width:30%;">Blue: <input type="checkbox" value="blue" name="colour[]"></td><td style="width:35%;">Gold: <input type="checkbox" value="gold" name="colour[]"></td></tr><tr><td style="width:35%;">Grey: <input type="checkbox" value="grey" name="colour[]"></td><td style="width:30%;">Pink: <input type="checkbox" value="pink" name="colour[]"></td><td style="width:35%;">Red: <input type="checkbox" value="red" name="colour[]"></td></tr><tr><td style="width:35%;">Silver: <input type="checkbox" value="silver" name="colour[]"></td><td style="width:30%;">White: <input type="checkbox" value="white" name="colour[]"></td><td style="width:35%;">Any/Other: <input type="checkbox" value="ANY" name="colour[]"></td></tr>
</table>
<input type="submit"/>
</form>
</body>
THE SCRIPT
$screen=$_POST['screen'];
$color=$_POST['colour'];
while ( (list ($key,$val) = @each ($screen)) || (list ($k,$v) = @each ($color)) ) {
///Output should be
first $val in list followed by $v;
then second $val in list followed by SAME $v
}
So say if i checked in the Screen: a,b,c,d.
Then checked in color: 1,2,3,6,7,9.
would like it to output:
a,1,2,3,6,7,9
b,1,2,3,6,7,9
c,1,2,3,6,7,9
d,1,2,3,6,7,9
NOT like a,b,c,d,1,2,3,6,7,9 which it does now.
thanks in advance hope someone can help me