title: i want to send error message through php get method if user already exists in database but then reset the url without GET variable
body: <p>After getting the error message through url i am throwing an error message through p tag</p>
  
  <p>and then using window.location.pushstate({}, "Hide", "<a href="http://localhost/shravari/project1/register.html" rel="nofollow noreferrer">http://localhost/shravari/project1/register.html</a>") method to have a clean url without the error message</p>
  
  <p>this is my php code</p>
  
  <pre><code>header('Location:../register.html?error=1');
  </code></pre>
  
  <p>this is my javascript code</p>
  
  <pre><code>var currentUrl = $(location).attr('href');  
      if (currentUrl.match(/error=1/g)) {
         $('#erroru').html('User already exists, please &lt;a href="login.html"&gt;login&lt;/a&gt; to access the page');
          $('#erroru').css('color','red');
          $('#erroru').css('text-algin','center');
          // window.location.assign('http://localhost/shravari/project1/register.html'); 
          window.history.pushState({}, "Hide", "http://localhost/shravari/project1/register.html");
  
      }
  </code></pre>
  
  <p>the window.location.assign('<a href="http://localhost/shravari/project1/register.html" rel="nofollow noreferrer">http://localhost/shravari/project1/register.html</a>'); works very well on mac system that is the error is displayed in p tag and the url don't hold the get method error variable but doesn't work on windows</p>
  
  <p>and the  window.history.pushState({}, "Hide", "<a href="http://localhost/shravari/project1/register.html" rel="nofollow noreferrer">http://localhost/shravari/project1/register.html</a>"); works on windows system that is the error is displayed in p tag and the url don't hold the get method error variable but doesn't work on mac
  And in both the systems i used chrome</p>