title: How to find the value of a user created button
body: <p>At first I created the buttons and therefore I knew the name of the button and was able to use:</p>
  <pre><code>//function button clicked 
  if (isset($_POST['thenameofthebutton'])) {
  
  }
  </code></pre>
  <p>I would simply write the name manually in the code  for the button in my function &quot;button clicked&quot;.</p>
  <p>However now the buttons are created from user data with PHP and SQL.</p>
  <p>I create the buttons like this and its working fine:</p>
  <pre><code>$sql = &quot;SELECT * FROM chooseCategory&quot;;
  $result = mysqli_query($con,$sql);
  while($row = mysqli_fetch_array($result)) {
      echo ' &lt;input type=&quot;submit&quot; name=&quot;'.$row['Name']
      .'&quot; value=&quot;'.$row['Name']
      .'&quot;&gt;
      &lt;/form&gt;';
  }
  </code></pre>
  <p>My question is how I can create my function &quot;button clicked&quot; so it works dynamically with the buttons being created from user input instead of me manually creating them in code.</p>