title: keep the url same after form submission in php
body: <p>I have this simple form that updates the values in database, the url of the page is</p>
  
  <pre><code>www.example.com?id=1
  </code></pre>
  
  <p>After i submit the form the values get updated and i get a success message but the url gets changed, it becomes</p>
  
  <pre><code>www.example.com
  </code></pre>
  
  <p>Can anyone tell how i can keep the url same <code>i.e: www.example.com?id=1</code></p>
  
  <p>The code is as follows</p>
  
  <pre><code>&lt;?
  if ($_SERVER["REQUEST_METHOD"] == "POST") 
      {
          $text = mysqli_real_escape_string($con, $_POST['textvalue']);
          $title = mysqli_real_escape_string($con, $_POST['title']);
          $blogid = mysqli_real_escape_string($con, $_POST['blogid']);
  
          $sql = "UPDATE blog SET text='".$text."', title='".$title."'  WHERE id='".$blogid."'";
          if (mysqli_query($con, $sql)) 
              {
                  $msg = "Blog updated";
              } 
          else 
              {
                  echo "There was an error";
              }
      }
  ?&gt;
  
  &lt;div&gt;
      &lt;?
          if($msg!="")
              {
                  echo $msg;
              }
      ?&gt;  
      &lt;form action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;" method="post" enctype="multipart/form-data" &gt;
  
          &lt;input type="text" name="title"  value="&lt;? echo $title; ?&gt;" style="width:100%;"/&gt;
          &lt;textarea name="textvalue" &gt;&lt;? echo $text; ?&gt;&lt;/textarea&gt;
          &lt;input type="hidden" name="blogid"  value="&lt;? echo $blogid; ?&gt;"/&gt;
          &lt;input type="submit" name="edit" alt="edit" value="Edit"/&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>