title: PHP - php parameters change one keep the others
body: <p>I have the following urls</p>
  
  <pre><code>//Colour
  &lt;a href="page.php?color=red"&gt;Red&lt;/a&gt;
  &lt;a href="page.php?color=blue"&gt;Blue&lt;/a&gt;
  &lt;a href="page.php?color=green"&gt;Green&lt;/a&gt;
  
  //Size
  &lt;a href="page.php?size=small"&gt;Small&lt;/a&gt;
  &lt;a href="page.php?size=medium"&gt;Medium&lt;/a&gt;
  &lt;a href="page.php?size=large"&gt;Large&lt;/a&gt;
  </code></pre>
  
  <p>I would like a customer to choose both a colour and a size.</p>
  
  <p>Question 1:
  If the customer chooses blue he will select <code>&lt;a href="page.php?color=blue"&gt;Blue&lt;/a&gt;</code>. Now if he chooses size small, how can I add the size parameter to <code>color=blue</code>.</p>
  
  <p>Question 2:
  Like in the above. If now the customer decides to keep the colour blue, and change the size from small to medium, using PHP how can I change the URL from 
  <code>page.php?color=blue&amp;size=small</code> to <code>page.php?color=blue&amp;size=medium</code> without losing the <code>color=blue</code> parameter and without creating a link for each color and size e.g. <code>page.php?color=blue&amp;size=small</code>, <code>page.php?color=blue&amp;size=medium</code>, <code>page.php?color=blue&amp;size=large</code>, <code>page.php?color=red&amp;size=small</code>, <code>page.php?color=red&amp;size=medium</code>, <code>page.php?color=red&amp;size=large</code></p>
  
  <p>Thank you.</p>