title: Retrieve $_POST value from submit button
body: <p>I have a front end form and want to retrieve user input vale using <code>$_POST</code> in a variable. I had found similar threads here, but none of it couldn't solve my problem.</p>
  
  <p>After accepting the variable in <code>$data</code>, I tried to print using <code>echo $data</code>. Nothing is shown. (But when I use other form input such as drop down or check box, <code>$data</code> contains data. I require the button type as mentioned here and wont be able to change).</p>
  
  <p>HTML Form</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;form action="test_general.php" method="post" &gt;    
              &lt;input type="submit"  name="btn" value="but1"&gt;text1&lt;/button&gt;
              &lt;button type="submit" name="btn" value="but2"&gt;text2&lt;/button&gt;    
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;html&gt;
  </code></pre>
  
  <p>PHP processing code</p>
  
  <pre><code>&lt;html&gt;
      &lt;?php
          $data = $_POST['value'];
          echo $data;
      ?&gt;
  &lt;html&gt;
  </code></pre>