I have a form that contain multiple button displayed by database I want to open each button by it's ID. This is what I tried It didn't work whene I use variable in ISSET POST.
<form method="post" action="" enctype="multipart/form-data">
<?php
if (mysqli_num_rows($result) > 0) { ?>
<?php
$i=0;
while($row = mysqli_fetch_array($result)) {
$nom=$row['nom'];
?>
<div class="card" style="width: 10rem; margin:4px">
<div style="height: 48px;">
<?php echo "<img class='card-img-top' alt='' src='../admin/image/mercedes/".$row['image']."' >";?>
</div>
<div class="card-body">
<input type="submit" id="button1" class="btn" name="<?php echo "$nom"; ?>" Value="<?php echo "$nom"; ?>" />
</div>
</div>
<?php
$i++;
}
?>
</form>
At this is the isset post:
<?php
if(ISSET($_POST[$nom]))
{
echo '<script type="text/javascript">';
echo ' alert("JavaScript Alert Box by PHP")'; //not showing an alert box.
echo '</script>';
}
?>