title: Form refresh after submit
body: <p>The form below can contains different elements of text fields, drop down and selection boxes, which allows the user to update his profile. The process of updating MySQL fields is being done after form submits. </p>
  
  <pre><code>&lt;form method="post"&gt;
  My Name: &lt;input name="myname" type="text" value="&lt;?php echo $_SESSION['SESS_MY_NAME']; ?&gt;" /&gt;&lt;br /&gt;
  My Email: &lt;input name="email" type="text" value="&lt;?php echo $_SESSION['SESS_EMAIL']; ?&gt;" /&gt;&lt;br /&gt;
      &lt;input type="submit" name="Submit" value="Update" /&gt;
  
  &lt;?php
  if (isset($_POST['Submit'])) {
      // MySQL update
      ;
      ;
      ;
      $result=mysql_query($sql);
    }
  
  // if successfully updated, make form refresh. 
    if($result){
      ;
      ;
      ;
    }
  ?&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to refresh only the form, so that the user will stay in the same page and will see the changes that he made (i.e. What do I need to put under the comment in the code “if successfully updated, make form refresh”?).</p>
  
  <p>I cannot use <code>header("location: samepage.php");</code> because I have too many HTML codes involved in between and before.</p>
  
  <p>Appreciate any help,</p>