I have a login form
if I enter the wrong credentiallls, I get an error message (which closes after 3.5 seconds) using
<div id="login" class="overlay">
<div class="popup">
<div class="content">
<a class="close" id="close_login" href="#">×</a>
<div class="card m-0">
<h3 class="card-header">
<span class="icon-signin"></span> Login
</h3>
<div class="card-body">
<div class="alert alert-light border border-light shadow-sm" role="alert">
<form action="" method="POST">
<div class="form-group">
<label for="Email">Email</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text text-secondary">@</span>
</div>
<input type="email" class="form-control" id="Email" name="Email" required>
</div>
</div>
<div class="form-group">
<label for="Password">Password</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text text-secondary"><i class="icon-lock"></i></span>
</div>
<input type="password" class="form-control" id="Password" name="Password" required>
</div>
</div>
<div class="form-row">
<div class="col">
<button class="btn btn-dark btn-block" name='loginSubmit' type="submit"><span class="icon-ok"></span> Submit</button>
</div>
</div>
</form>
</div>
<!--<h6 class="text-right text-secondary"><a href="#forgot_password">Forgot Password</a></h6>-->
</div>
</div>
</div>
</div>
</div>
<?php if(isset($_POST['loginSubmit'])){ ?>
<div id="login_result" class="overlay" style="visibility:visible; opacity:1">
<div class="popup">
<div class="content">
<a class="close" id="close_login" href="#">×</a>
<div class="card m-0">
<h3 class="card-header" style="color:<?=$popup_card_text_color?>; background-color:<?=$popup_card_header_background?>">
<?=$popup_card_header?>
</h3>
<div class="card-body" style="color:<?=$popup_card_text_color?>; background-color:<?=$popup_card_body_background?>">
<?=$popup_card_body?>
</div>
</div>
</div>
</div>
</div>
<script>
document.getElementById("login").style.display = "none";
setTimeout(function(){
document.getElementById("login_result").style.display = "none";
}, 3500);
</script>
<?php } ?>
the login form in at the login id so the URL becomes index.php#login
How can I (after submitting the login form, change the URL to only the page (index.php) and not the #login target?