I have a table with some information from my database. I have buttons next to each row in the table. If the button is clicked it should send an email to the user. I can give each button a unique value but can not have this value in the if isset.... How should i get the value of the button name to be variable and how could i get the value at the end of my url.
echo "<table>";
echo "<tr><td>Naam</td><td>EmailAdress</td><td>Datum</td><td>Type</td><td>Producent</td><td>SerieNummer</td><td> imei</td><td>Manager</td><td>bevestigd</td></tr>";
while($row = mysqli_fetch_row($result)){
$sqlid = "SELECT Bevestigd FROM tbl_bevestiging WHERE IDbewijs = " . $row[0];
$resultid = mysqli_query($conn, $sqlid);
$row2 = mysqli_fetch_row($resultid);
echo "<tr><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row [6] . "</td><td>" . $row[7] . "</td><td>" . $row[8] . "</td><td>" . $row2 [0] . "</td><td><form method=\"post\"><input name=\"" . $row[0] . "\" type=\"submit\" value=\"" . $row[0] . "\"</form></td></tr>";
}
echo "</table>";
if (isset($_POST[$row[0]])){
$admin_email = "adminmail@mail.com," . $row[2];
mail($admin_email, "Ontvangstbewijs geleverde hardware herverstuurd", "url?id=" . $row [0] , "From:" . "example@email.com");
mysqli_close($conn);
}
?>