title: Query string is appending when using $_SERVER['HTTP_REFERER']
body: <p>Can someone explain me why when I execute this code multiple times it append the substring <code>?val=1</code> to my url? </p>
  
  <p>Example: My script is located in index.php and if I execute it 3 times I will have this url in my browser: <code>http://localhost/index.php?val=1?val=1?val=1</code></p>
  
  <p>I would like to have <code>http://localhost/index.php?val=1</code> . . .</p>
  
  <pre><code>&lt;?php
          if(isset($_POST['hidden']) &amp;&amp; $_POST['hidden'] == 2){
              $page = $_SERVER['HTTP_REFERER'];
              header("location: $page?val=1");
          }
  ?&gt;
      &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="POST"&gt;
          &lt;input name ="hidden" value="2"&gt;
          &lt;input type="submit"&gt;
      &lt;/form&gt;
  </code></pre>