title: How can I open submit button with dynamic name?
body: <p>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.</p>
  <pre class="lang-php prettyprint-override"><code>    &lt;form method=&quot;post&quot; action=&quot;&quot; enctype=&quot;multipart/form-data&quot;&gt;
  
      &lt;?php
      if (mysqli_num_rows($result) &gt; 0) { ?&gt;
  
      &lt;?php
      $i=0;
      while($row = mysqli_fetch_array($result)) {
          $nom=$row['nom'];
      ?&gt;
  
      &lt;div class=&quot;card&quot; style=&quot;width: 10rem; margin:4px&quot;&gt;
          &lt;div style=&quot;height: 48px;&quot;&gt;
              &lt;?php echo &quot;&lt;img class='card-img-top' alt='' src='../admin/image/mercedes/&quot;.$row['image'].&quot;' &gt;&quot;;?&gt;
          &lt;/div&gt;
          &lt;div class=&quot;card-body&quot;&gt;
              &lt;input type=&quot;submit&quot; id=&quot;button1&quot; class=&quot;btn&quot; name=&quot;&lt;?php echo &quot;$nom&quot;; ?&gt;&quot; Value=&quot;&lt;?php echo &quot;$nom&quot;; ?&gt;&quot; /&gt;
          &lt;/div&gt;
          
      &lt;/div&gt;
  
      &lt;?php
      $i++;
      }
      ?&gt;
  &lt;/form&gt;
  </code></pre>
  <p>At this is the isset post:</p>
  <pre class="lang-php prettyprint-override"><code>&lt;?php
    if(ISSET($_POST[$nom]))
      {
       echo '&lt;script type=&quot;text/javascript&quot;&gt;';
       echo ' alert(&quot;JavaScript Alert Box by PHP&quot;)';  //not showing an alert box.
       echo '&lt;/script&gt;'; 
      }
  ?&gt;
  </code></pre>
  <p>Here is the image
  <a href="https://i.stack.imgur.com/Tm1Py.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tm1Py.png" alt="image1" /></a></p>