title: Add / Change parameter of URL and redirect to the new URL
body: <p>If the <code>&amp;view-all</code> parameter does NOT exist in the URL I need to add it to the end of the URL along with a value. If it DOES exist then I need to be able to just change the value without creating a new URL because it might, or might not, have other parameters before it.</p>
  
  <p>I found this function but I can't get it to work: <a href="https://stackoverflow.com/a/10997390/837705">https://stackoverflow.com/a/10997390/837705</a></p>
  
  <p>Here is the code I have using the function above (which I can't get to work): <a href="http://jsfiddle.net/Draven/tTPYL/4/" rel="noreferrer">http://jsfiddle.net/Draven/tTPYL/4/</a></p>
  
  <p>I know how to append the parameter and value already:</p>
  
  <p><code>&lt;div onclick="javascript: window.location.assign(window.location.href+='&amp;view-all=Yes');"&gt;Blah Blah&lt;/div&gt;</code></p>
  
  <p><strong>More Info:</strong></p>
  
  <p>If the URL is <code>http://www.domain.com/index.php?action=my_action</code> then the default "&amp;view-all" value would be "Yes" so the  URL they would be directed to when they click the button is <code>http://www.domain.com/index.php?action=my_action&amp;view-all=Yes</code>.<br><br></p>
  
  <p>If the URL is <code>http://www.domain.com/index.php?action=my_action&amp;view-all=Yes</code> then when they click the button it would change to <code>http://www.domain.com/index.php?action=my_action&amp;view-all=No​​​</code></p>
  
  <p><strong>EDIT:</strong> Please give me examples. I don't know alot of JS, and I just can't think of a way to do it in PHP.</p>