title: PHP remove querystring from url
body: <p>I am building a website and I have come across something that I do not know how to do.</p>
  
  <p>I have a link on every page that members of my website can click, and when they do it takes them to the same page with a query on the end, and a confirmation link like;</p>
  
  <pre><code>/contact?tab=hotlink
  </code></pre>
  
  <p>Now on this page is a hidden form and a confirm button, I was going to use                 $_SERVER['HTTP_REFERER'], but the previous url is /contact?tab=hotlink and I need it to be...</p>
  
  <pre><code>/contact
  </code></pre>
  
  <p>Is there a way to string replace all of the query, I could do it with sessions, but would rather do it another way as it would mean setting alot of unnessessary sessions.</p>
  
  <p>Thanks</p>