I've been trying to use this script called "Sweet alert" in my form because I want my site with a nice look. The thing is that when I want to login, my document called validar.php recognize user and password normally but it doesn't redirect to other page.
I've already added these "Sweet alert" libreries at the beggining of my program.
if($f3=mysqli_fetch_assoc($sql3))
{
if($pass==$f2['contraAdmin'] && $administrador==$f3['tipoUsuario'])
{
echo "<script>
swal({
title: 'Acceso',
text: '¡Bienvenido Administrador!',
type: 'success',
confirmButtonText: 'Aceptar',
showLoaderOnConfirm: true, },
function(){
location.href = 'RegistroEmp.php';
});
</script>";
}
Therefore, when I use an script alert it works perfectly.
echo '<script>alert("Welcome Admin")</script> ';
echo "<script>location.href='RegistroEmp.php'</script>";
Thanks. I hope you can help me. Regards!