I need a little help determining method of coding that would allow me to in an array of IDs from a table generate an ISSET to gather that information for use. How this works is a user(Captain) sees a HTML Table list of multiple people(Players). There is a "Email" button on this page that allows the user(Captain) to contact that person (Player). I do not want any personal data of the person(Player) for the user(Captain) to see. Once the user(Captain) hits the "Email" button an internal email is sent to the person(Player) with the user's(Captain's) email address. Captain's understand that only there email address will be used.
This is the code that does work:
HTML:
<table id ="example" class="tg" style="undefined;table-layout: fixed; width: 1350px">
<colgroup>
<col style="width: 250px">
<col style="width: 100px">
<col style="width: 150px">
<col style="width: 300px">
<col style="width: 150px">
<col style="width: 200px">
<col style="width: 200px">
</colgroup>
<thead>
<tr>
<th class="tg-0lax">Player</th>
<th class="tg-0lax">Gender</th>
<th class="tg-cly1">Player Level</th>
<th class="tg-cly1">League</th>
<th class="tg-cly1">State</th>
<th class="tg-cly1">County</th>
<th class="tg-cly1">Contact</th>
</tr>
</thead>
<tbody>
<?php
while($row3 = mysqli_fetch_array($result_plyrs))
{
?>
<form method='POST'>
<tr>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[0]; ?></td>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[1]; ?></td>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[2]; ?></td>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[3]; ?></td>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[4]; ?></td>
<td class="tg-cly1" style="text-align:center"><?php echo $row3[5]; ?></td>
<td style="text-align:center"><input type="submit" value="Email" name="<?php echo $row3[6];?
>"></td>
</tr>
</form>
<?php
}
?>
</tbody>
</table>
PHP:
$sqlPlyrslkg = "Select ID, FROM wp_plyrlkg WHERE league='Adult-Team'";
$resPlyr = mysqli_query($link, $sqlPlyrslkg);
$Plyrlkg_ID = array();
while ($rowPlyrlkg = mysqli_fetch_array($resPlyr)) {
$Plyrlkg_ID[] = (int)$rowPlyrlkg[0];
}
if(isset($_POST["$Plyrlkg_ID[0]"])){{
....
}
if(isset($_POST["$Plyrlkg_ID[1]"])){{
....
}
if(isset($_POST["$Plyrlkg_ID[2]"])){{
....
}
if(isset($_POST["$Plyrlkg_ID[3]"])){{
....
}
In this case I am showing 4 possibilities, I need a way to handle possibly 100 or more possibilities. How can I do this efficiently?