Curso de PHP🐘 y MySql🐬 [20.- Condicional if y login en php]
En este tutorial vamos a continuar trabajando con la condicional if else y ademas vamos a hacer un login sencillo en php.
Codigo: https://github.com/programadornovato/php/commit/9dc31068b3eba3f292fd2e764720070fa02566ef
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="bootstrap.min.css"> <title>Login</title> </head> <body> <div class="container mt-2"> <div class="row"> <div class="col-12"> <form method="post"> <div class="form-group"> <label>Email address</label> <input type="email" class="form-control" name="email" placeholder="Email"> </div> <div class="form-group"> <label>Password</label> <input type="password" class="form-control" name="pass" placeholder="Password"> </div> <button type="submit" class="btn btn-primary" name="enviar" value="enviar">Enviar</button> </form> </div> </div> <div class="row"> <div class="col-12"> <?php if(isset($_POST['enviar'])){ $email=$_POST['email'] ?? ''; $pass=$_POST['pass'] ?? ''; if($email=='info@programadornovato.com' && $pass=='123456' ){ ?> <div class="alert alert-primary" role="alert">Simon chavo ya entraste</div> <?php }else{ ?> <div class="alert alert-danger" role="alert">Nel no pasas</div> <?php } } ?> </div> </div> </div> </body> </html>
Colocar https (ssl) a mi dominio de GoDady gratis (2019): https://www.youtube.com/watch?v=3oc46TtOU6Q
? Esta lista de reproducción: https://www.youtube.com/playlist?list=PLCTD_CpMeEKS2Dvb-WNrAuDAXObB8GzJ0
Codigos en gdrive: https://drive.google.com/file/d/1tQwYvfL2jiUFc6beTWkOkGmXkq5zzFw2/view?usp=sharing
Gracias por apoyar este canal: https://www.patreon.com/programadornovato?fan_landing=true
? Facebook: https://facebook.com/ProgramadorNovatoOficial
? Twitter: https://twitter.com/programadornova
? Linkedin: https://www.linkedin.com/in/programadornovato/
? Instagram: https://www.instagram.com/programadornovato/
Ave que vuela, a la cazuela.