if(!$reg['iduser']){ echo" <script> alert('EL USUARIO NO EXISTE !!!!!'); </script> "; echo" <script> location.replace('index.php'); </script> "; }