title: How to get and change URL variable PHP
body: <p>Hi could anyone help me with this
  I have a URL like</p>
  
  <pre><code>parent/child/a=1&amp;b=2$c=3
  </code></pre>
  
  <p>then I have a link that would add variable to that URL</p>
  
  <pre><code>&lt;a href="&lt;?php echo $_SERVER["REQUEST_URI"]."&amp;d=test1";?&gt;"&gt;LINK 1&lt;/a&gt;
  &lt;a href="&lt;?php echo $_SERVER["REQUEST_URI"]."&amp;d=test2";?&gt;"&gt;LINK 2&lt;/a&gt;
  </code></pre>
  
  <p>every time I click my link the variable d to URL keep on reproducing like this</p>
  
  <pre><code>parent/child/a=1&amp;b=2&amp;c=3&amp;d=test2&amp;d=test2&amp;d=test2&amp;d=test1&amp;d=test1
  </code></pre>
  
  <p>I know that the $_SERVER["REQUEST_URI"] keep getting the current URL that is why I get that result. I have tried the some of properties of $_SERVER[""].
  What I like is to change the d variable value, any idea how to do it. 
  Any response is well appreciated.Thanks!</p>