On my form I've got a select from a table. I've put it in a for loop so that each time the name of the select changes to option0, option1, etc. Then on the action page of the form I need to get the info for each option selected, eg $_POST['option0'], $_POST['option1'], etc to input it into a table. I can't get the action page to work, what am I doing wrong?
PAGE1
for ($x = 0; $x <= 14; $x++) {
$get2a = mysqli_query($con,"SELECT * FROM table");
$opt = "<select name='interviewer". $x . "'>";
while($row2a = mysqli_fetch_array($get2a)) {
$intvID = $row2a['intvID'];
$opt .= "<option value = '";
$opt .= $row2a['intvID'];
$opt .= "'>";
$opt .= $row2a['intvID'];
$opt .= "</option>";
}
PAGE 2
for ($y = 0; $y <= 14; $y++) {
echo $_POST['interviewer . $y . '];
}
You are calling your selectable options sets
$opt = "<select name='option". $x . "'>";
So Page2 should be looking for things names 'option0' ... 'option13'` like this