-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
84 lines (62 loc) · 1.95 KB
/
Copy pathindex.php
File metadata and controls
84 lines (62 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
if($_POST) {
include ('Classes/Conexao.class.php');
include ('Classes/UsuarioDAO.class.php');
$usuario = new UsuarioDAO();
$login = addslashes($_POST['login']);
$senha = addslashes($_POST['senha']);
$user = $usuario->login($login, $senha);
if($user == true) {
session_start();
$_SESSION['login'] = $login;
$_SESSION['senha'] = $senha;
header('location: admin.php');
} else {
header('location:index.php?erro=senha');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Projeto NASA</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php include('header.php') ?>
<div class="bd-pageheader bg-primary">
<div class="container">
<?php
if(isset($_GET['erro'])) {
echo '<div class="alert alert-danger">Dados de login incorretos</div>';
}
if(isset($_GET['success'])) {
echo '<div class="alert alert-success">Logout efetuado com sucesso</div>';
}
?>
<h2>Login</h2>
<hr>
<form action="#" method="post">
<div class="form-group">
<label for="login">Login</label>
<input type="text" class="form-control" id="login" name="login">
</div>
<div class="form-group">
<label for="senha">Senha</label>
<input type="password" class="form-control" id="senha" name="senha">
</div>
<input type="submit" class="btn btn-primary" name="logar" value="Logar">
<a href="cadastro.php" class="btn btn-primary"><i class="icon-user icon-white"></i>Cadastre-se</a>
</form>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
setTimeout(function() {
$('.alert').fadeOut();
}, 4000);
</script>
</body>
</html>