title: php get value of submit button when value is a variable
body: <p>I tried to search but was unable to find an answer for this question.</p>
  
  <p>I am trying to get the value of the button in my submit button that is a variable.</p>
  
  <p>CODE is as follows</p>
  
  <pre><code>$penrequest = "select * from request where status='pending';";
  $penreg = mysql_query($penrequest);
  echo "&lt;form method='post' action=''&gt;";
  while ($row = mysql_fetch_array($peneg))
  {
   echo "&lt;input type='submit' name='answer' value='$appdeny'&gt;";
  }
  
  if (isset($_POST['answer']))
  {
     echo $appdeny;
  }
  </code></pre>
  
  <p>Ok the code works...if you hit the button its caught by the if statement like its supposedt o be. the variable $appdeny is a messageID number filled from a mysql database which can change. When the user clicks a button i want to print the messageID of the number displayed as the value of the answer button. </p>