I am making a registration form and when checking the data I ask if the mail or the user is not registered, everything works fine, the problem is that once the error is displayed, I am ok and redirected to registration. php and I want you to stay in index.php
I leave the code where the problem should be
if ((mysqli_num_rows($existente)>0) or ($clave != $claverep)){
echo "<script>alert(\"Error en el registro\")</script>";
"<script> window.location.replace=../index.php'</script>";
}