Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'classes/usuario.php';
- $u = new Usuario;
- ?>
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <meta charset="utf-8">
- <title>BODE DA SORTE - Sorteios Entre Amigos</title>
- <link rel="stylesheet" href="css/estilo.css">
- </head>
- <body style="position: relative; top: 35px;">
- <SPAN style="position: absolute; top: -160px; left: 550px">
- <IMG SRC="imagens/logo.png" >
- </SPAN>
- <div id="corpo-form">
- <h1>Entrar no Sistema</h1>
- <form method="post">
- <input type="email" placeholder="Usuário" name="email">
- <img src="imagens/user.png" width="48" height="48" id="img_user">
- <input type="password" placeholder="Senha" name="senha">
- <img src="imagens/pass.png" width="48" height="48" id="img_pass">
- <input type="submit" value="Acessar">
- </form>
- </div>
- <?php
- if(isset($_POST['email']))
- {
- $email = addslashes($_POST['email']);
- $senha = addslashes($_POST['senha']);
- if(!empty($email) && !empty($senha))
- {
- $u->conectar("projeto_gestao","localhost","root","");
- if($u->msgErro =="")
- {
- if($u->logar($email,$senha))
- {
- header("location: area_restrita.php");
- }
- else
- {
- ?>
- <div class="msg-erro">
- Email e/ou senha estão incorretos!
- </div>
- <?php
- }
- }
- else
- {
- ?>
- <div class="msg-erro">
- <?php echo "Erro: ".$u->msgErro; ?>
- </div>
- <?php
- }
- }else
- {
- ?>
- <div class="msg-erro">
- Preencha todos os campos
- </div>
- <?php
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement