I currently have a form that is generated based on a number entered by the user on a previous page. If the user enters a 6, the generated form will display a table with 6 drop downs on it (all with the same selections in them). I have made the script name these controls within a FOR loop. Therefore, the name (and thus the variable name) will be AGE1,AGE2,AGE3 etc.
The problem I am having is referring to these on the following page. The code I currently have is:
<?php for ($j=1; $j <= $emps; $j++)
{
echo "$age", $j;
}
?>
$emps is the user entered value. This obviously gives me the output of 'age1age2' etc....
I guess what I am asking is do I need to learn how to use a variable array or is there some kind of operator that will tell php to output the value of $age1?
if I put the code
echo $age1
I get the value the user selected in that dropdown, so I know the value is being passed successfully.
Thanks in advance