title: Hey, I'm making a contact form, which has to redirect to the same page after submitted
body: <p>when the url is localhost/school/portfolio/contact.php it works fine, but when I use a get parameter index.php?page=contact it redirects to index.php</p>
  
  <p>The code I use</p>
  
  <pre><code>$url = "http". ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
          header('Location: '.$url."?sent=yes");
  </code></pre>
  
  <p>What do I have to add?</p>