How to refresh a php page on form submit?
<p>My issue is after submitting the form element in a <code>php</code> page, the page does not refresh. Here is my code.</p>

<pre><code>&lt;?php
    session_start();
    include('db.php');
    include('pages.php');
?&gt;
</code></pre>

<p><strong>form element</strong> </p>

<pre><code>&lt;form action = "&lt;?php echo $_SERVER['PHP_SELF'];?&gt;" method = "POST"&gt;
   &lt;table style="width:70%"&gt;
      &lt;tr&gt;
         &lt;td width="10%"&gt;First Name&lt;/td&gt;
         &lt;td width="20%"&gt;&lt;input style="border-radius: 4px; border: 2px solid gray; height: 20px; width: 180px;" type="text" name="fname" value="&lt;?php echo $f_name;?&gt;"&gt;&lt;/td&gt;
      &lt;/tr&gt;

&lt;input style="border-radius: 5px; width: 100px; height: 25px;" type="submit" name="account_update" value="Update"/&gt;&lt;/td&gt;
   &lt;/table&gt;
&lt;/form&gt;

if(isset($_POST['account_update']) &amp;&amp; $_POST['account_update'] == 'Update'){

    $fname_edit = $_POST['fname'];

    $sql = $db-&gt;prepare("SELECT * from table where email = ?");
    $sql-&gt;bind_param("s",$email);
    $sql-&gt;execute();
    $sql = $sql-&gt;get_result();
    if(($getRowCount = $sql-&gt;num_rows) == 1){
    $updateQuery = $db-&gt;prepare("UPDATE info set first_name=? where email = ?");
                                       $updateQuery-&gt;bind_param("ss",$fname_edit,$email);
    $updateQuery-&gt;execute();
       }        
    }

 ?&gt;
</code></pre>

<p>So clicking on update, inserts the data in the tale, but it only shows up on the page when I refresh it for a second time.</p>

<p>Also. <code>pages.php</code> is another page being fetched by including. My current page gets refreshed fine if I remove the <code>include('pages.php')</code>, but not with it. Any suggestions on how to get this thing out this would be of great help. </p>