-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.php
64 lines (51 loc) · 2.08 KB
/
index.php
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
<?php
if(isset($_COOKIE['admin'])){
header("Location:home.php");
}
if(isset($_COOKIE['usuario'])){
header("Location:homeusuario.php");
}
if(isset($_COOKIE['tecnico'])){
header("Location:hometech.php");
}
include "include/header.php" ;
// o erro 200 é quando desloga e o 404 é quando tenta logar.
if(isset($_GET['mensagem'])){
$err = $_GET['mensagem'];
if($err == 200){
echo "<script>alert('Você foi deslogado com sucesso!');</script>";
}else if($err == 404){
echo "<script>alert('Login ou Senha Invalida!');</script>";
}
}
?>
<div class="clear3"></div>
<section id="index">
<div class="index container">
<div class="row">
<div class="col-md-12 col-xs-12">
<form action="login.php" method="post" class="acesso panel panel-default">
<div class="panel-heading text-center">
Acesso Restrito
</div>
<div class="panel-body">
<div class="form-group">
<label for="usuario">Login:</label>
<input id="usuario" name="login" class="form-control" type="text" required autofocus>
</div>
<div class="form-group">
<label for="senha">Senha:</label>
<input id="senha" name="senha" class="form-control" type="password" required>
</div>
</div>
<div class="panel-footer pull text-center">
<button type="reset" class="btn btn-danger">Limpar</button>
<button id="botaoLogin" type="submit" class="btn btn-primary">Entrar</button>
</div>
</form>
</div>
</div>
</div>
</section>
<div class="cleardown"></div>
<?php include "include/footer.php" ?>