title: How to redirect URL when php get string is in current url
body: <p>Here is my HTML button:</p>
  
  <pre><code>&lt;button class="button-brightgreen" onclick="cancelbutton();"&gt;Cancel&lt;/button&gt;
  </code></pre>
  
  <p>Here is my JavaScript redirect:</p>
  
  <pre><code>function cancelbutton() {
      var cancelURL = 'http://localhost:51937/php/searchUsers.php';
      $(location).attr('href', cancelURL);
  }
  </code></pre>
  
  <p>This is on my editUser.php page. This code works fine for me, except when there is a php GET string in the current URL such as <em>?user_id=19</em></p>
  
  <p>When there is a GET in the URL and I click the cancel button, it takes me back to the same page (editUser.php) and displays <em>""</em></p>
  
  <p>How can I get the redirect to work when there is a GET in the current URL?</p>