title: Delete GET params from current URL
body: <p>Currently i'm using a javascript to confirm a form.</p>
  
  <pre><code>echo "&lt;script&gt;
  var x = document.URL;
  var r = confirm('Are you sure?');
  if (r == true) {
  window.location.search += '&amp;answer=1'; 
   &lt;/script&gt;";
  </code></pre>
  
  <p>so it add the get param "answer", and in my php file i check the number (if answered "Cancel it returns 0), but i need to delete this param from my url after checking it, but I didn't find anything to do it.</p>
  
  <p>my URL should be like this in the process.</p>
  
  <pre><code>starting url = www.myurl.com
  </code></pre>
  
  <p><strong>user send the form, and answers "yes" to the question</strong></p>
  
  <pre><code>current url = www.myurl.com?answer=1;
  </code></pre>
  
  <p><strong>php check the get variable and to things if answered "yes", after finish the function it modified the url</strong></p>
  
  <pre><code>url after php function = www.myurl.com
  </code></pre>