title: Get input textbox value into a PHP variable in WordPress
body: <p>I am trying to get a input textbox value in a PHP variable and then update a table based on this variable value in my custom WordPress page. I have written following code.</p>
  
  <p>It is working but not updating the text input value. What is wrong with my code?</p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data"&gt;
   &lt;td&gt;
      &lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;input type="text" name="offeramt" style="height:15px"/&gt; &lt;td&gt;
   &lt;input type="hidden" name="pid" value= "&lt;?php echo $retrieved_data-&gt;id; ?&gt;"&gt;
   &lt;input type="hidden" name="textamount" value="&lt;?php echo htmlspecialchars($_POST['offeramt']);?&gt;"&gt;
   &lt;input type="submit" name="update" value="update"  /&gt;&lt;/td&gt; &lt;/table&gt;&lt;/td&gt;
  &lt;/form&gt;
  
  &lt;?php 
  
  
   if (isset($_POST['update'])) {
  
          $sellamt=$_POST['textamount'];
  
          if (empty($sellamt)){
           echo "pls input a value in text box";
          }
  
          else{
  
          $myid = $_POST['pid'];
  
          ?&gt; &lt;?php
               $wpdb-&gt;update('wp_share', array('status'=&gt;'onsell','offervalue'=&gt;$sellamt),array('id'=&gt;$myid));
  
          }}
  
  
  }?&gt;
  </code></pre>