title: how to let js alert box pop up at the same page?
body: <p>An alert box will pop up after I submit my registration form , but the alert box will always pop up in a blank page.</p>
  <p>What can I do to let the alert box pop up at the same page of my registration form?</p>
  <p>My alert box:</p>
  <pre><code> if($query){
      echo  &quot;&lt;script&gt;alert('Invoice sent succefully')&lt;/script&gt;&quot;;
      echo &quot;&lt;script&gt;window.location.href ='add-client.php'&lt;/script&gt;&quot;;
      }}?&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/oNFY6.png" rel="nofollow noreferrer">Blank page where alert box pop up</a></p>