Hi,
I have form that populates an array, but when I try and retrieve the contents of the array, they return as blank.
Form code is
$count="0";
While ($count<$num_rows){
?>
<div>
<label><?echo"$Part1[$count]"?></label>
<input type="checkbox" name="<?echo"$Part1[$count]"?>" >
</div>
<?
$count++;
}
?>
<div>
<button type="submit" class="btn" name="submit">Submit</button>
</div>
When I try and access the array with
$name = $_POST[Part1[0]];
echo"1 $name<br>";
$name = $_POST[Part1[1]];
echo"2 $name<br>";
$name = $_POST[Part1[2]];
echo"3 $name<br>";
$name = $_POST[Part1[3]];
echo"4 $name<br>";
$name = $_POST[[Part1[4]];
echo"5 $name<br>";
I get the exact results I entered in the form, but if I try and use ;
$num_rows="5";
$count="0";
While ($count<$num_rows){
$name = $_POST[Part1[$count]];
echo"1 $name<br>";
$count++;
}
I get blanks.
Any assistance for a new coder appreciated.
Jon