title: Data disappear from from in php after page refresh
body: <p>Data disappear when i reload/refresh the form.</p>
  
  <p><strong>My query for getting data..</strong></p>
  
  <pre><code> public function view_detail()
      {
          $qry=$this-&gt;conn-&gt;prepare("SELECT * FROM student_detail WHERE Student_Cnic=:search OR Student_Name=:search");
          $qry-&gt;bindParam(':search',$this-&gt;stsearch);
  
          $qry-&gt;execute();
          return $qry;
      }
  </code></pre>
  
  <p><strong>The form from where i am sending data</strong></p>
  
  <pre><code> &lt;form action="view.php" method="post" id="view_form"&gt;
                              &lt;br&gt;
                              &lt;label for=""&gt;View By Name or CNIC&lt;/label&gt;
                              &lt;input type="text" class="form-control" name="stu-view" id="stu-view" placeholder="Student Name or CNIC"&gt;&lt;br&gt;
  
                              &lt;input type="submit" name="view-detail" id="view-detail" class="btn btn-success" value="Enroll"&gt;&lt;br&gt;
                          &lt;/form&gt;
  </code></pre>
  
  <p><strong>The form where i am populating data</strong></p>
  
  <pre><code>&lt;?php
  include 'header.php';
  include 'config.php';
  include 'classes.php';
  $database=new Database();
  $db=$database-&gt;getConnection();
  $gtstu=new stu_sys($db);
  
  if(isset($_POST['stu-view']))
  {
  $_SESSION['stusearch'] = $_POST['stu-view'];
  if(isset($_SESSION['stusearch'])){
      $gtstu-&gt;stsearch = $_SESSION['stusearch'];
  }
  }
  $fth = $gtstu-&gt;view_detail();
  
  
  ?&gt;
  
  
  &lt;div class="row"&gt;
      &lt;div class="col-lg-12"&gt;
  
          &lt;div class="col-lg-2"&gt;&lt;/div&gt;
          &lt;div class="col-lg-8" style="margin-top: 10%;"&gt;
  
              &lt;table class="table table-responsive table-bordered"&gt;
                  &lt;th&gt;Image&lt;/th&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;th&gt;Cnic&lt;/th&gt;
                  &lt;th&gt;Department&lt;/th&gt;
                  &lt;th&gt;View Detail&lt;/th&gt;
                  &lt;?php while($row = $fth-&gt;fetch(PDO::FETCH_OBJ)):?&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;img src="images/&lt;?php echo $row-&gt;Student_Image; ?&gt;" alt=""/&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $row-&gt;Student_Name ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $row-&gt;Student_Cnic ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $row-&gt;Deprt ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;a href="#"&gt;View More Detail&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php endwhile;?&gt;
              &lt;/table&gt;
              &lt;a href="dashboard.php" class="btn btn-primary"&gt;Back TO Dashboard&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="col-lg-2"&gt;&lt;/div&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  
  
  
  
  
  
  
  
  
  
  &lt;?php
  include 'footer.php'
  ?&gt;
  </code></pre>
  
  <p>i don't know why the form goes empty, mean when i reload the page the data wiped..</p>
  
  <p>Any help will be appreciated.</p>