title: PHP Display result on same page
body: <pre><code> &lt;form action="" method="post"&gt;
       &lt;div id="wrapper"&gt;
           &lt;p&gt; 
               &lt;label&gt; Please Enter the JCID No &lt;/label&gt; 
               &lt;input type="text" name="txt_jcid_no" id="txt_jcid_no"/&gt;
               &lt;input type="submit" name="submit" value="Search" class="bg-primary"/&gt;
           &lt;/p&gt;
           &lt;table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%"&gt;
               &lt;thead&gt;
                   &lt;tr&gt;
                       &lt;th&gt;Name&lt;/th&gt;
                       &lt;th&gt;Position&lt;/th&gt;
                       &lt;th&gt;Office&lt;/th&gt;
                       &lt;th style="display: none"&gt;&lt;/th&gt;
                       &lt;th style="display: none"&gt; &lt;/th&gt;
                       &lt;th style="display: none"&gt;&lt;/th&gt;
                   &lt;/tr&gt;
               &lt;/thead&gt;
               &lt;?php
               if (isset($_POST['submit'])) {
                   echo 'Hi';
                   echo '&lt;tbody&gt;';
                   echo '&lt;/tbody&gt;'; 
               }
               ?&gt; 
           &lt;/table&gt;
           &lt;!-- /#page-content-wrapper --&gt;
       &lt;/div&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>Dear friends i want my php code to display the value on the same page , so what i do here is get <code>input(txt_jcid_no)</code> from the user and process the query and display the value in table format . But when i use <code>if isset()</code> function it displays the value while the page loads i.e before clicking the <code>submit</code> button but my requirement is the value should be displayed in table after clicking the submit button.</p>