Im writing a web page that updates scores on a database and i was wondering if i could pass a name + a variable through the form POST method e.g. (homeScore $i) where $i is the for loop index. the user can input a number to change the score and i will update the score in that database.
heres what i got in the first for loop
<input type="number" name="awayScore <?php echo $i; ?>" value="<?php echo $arrayScores[$i]['awayScore']; ?>">
and when i want to pull the POST in another for loop
$arrayScores[$j]['homeScore'] = $_POST["homeScore $j"];
so far i keep getting an error saying "Notice: Undefined index: homeScore 0" all the way to homeScore 6
Source: Ask PHP