title: how to send a variable value through form post in php?
body: <p>I have to post a value via "form post" and insert it into table, here is my code in both files: </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;table&gt;
  &lt;form  enctype="multipart/form-data" action="&lt;?php $_SERVER["DOCUMENT_ROOT"] ?&gt;  /contents/ad_posting_process_4.php" method="post"&gt;
  &lt;?php $cat_no = "101010"; ?&gt;
  &lt;input type=hidden id="category" value=" &lt;?php echo $cat_no; ?&gt; "&gt;  
  &lt;tr&gt; &lt;td&gt;Sub Category: &lt;/td&gt;&lt;td&gt;    &lt;input type=text id="sub_category" &gt; &lt;/td&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" name="action" value="Post"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tr&gt;
  &lt;/form&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>here is ad_posting_4.php</p>
  
  <pre><code>&lt;?php session_start();
  include($_SERVER["DOCUMENT_ROOT"]."/includes/conn.php");
  $category = mysql_real_escape_string($_POST['category']);
  $sub_category = mysql_real_escape_string($_POST['sub_category']);
  echo "category=". $category; 
  echo "sub_category=". $sub_category; ?&gt;
  </code></pre>
  
  <p>No value sent through post.</p>
  
  <p>where am I wrong?</p>
  
  <p>Regards:</p>