-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcadastro.php
More file actions
59 lines (59 loc) · 2.14 KB
/
cadastro.php
File metadata and controls
59 lines (59 loc) · 2.14 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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="cadastro.css">
<title>Cadastro</title>
</head>
<body>
<h1>CADASTRO</h1>
<div class="verificacoes">
<?php
if (isset($_SESSION['usuario_existe'])):
?>
<div class="erro_usuario">
<p>Usuário já cadastrado.</p>
</div>
<?php
elseif (isset($_SESSION['email_existe'])):
?>
<div class="erro_email">
<p>Email já cadastrado.</p>
</div>
<?php
elseif (isset($_SESSION['senha_diferente'])):
?>
<div class="erro_senha">
<p>As senhas não coincidem.</p>
</div>
<?php
endif;
unset($_SESSION['usuario_existe']);
unset($_SESSION['email_existe']);
unset($_SESSION['senha_diferente']);
?>
</div>
<div class="formulario">
<form method="POST" action="scadastro.php">
<label for="fusuario" id="utext">Nome de usuário</label>
<input type="text" id="fusuario" name="usuario" minlength="4" maxlength="15" required><br><br>
<label for="femail" id="etext">E-mail</label>
<input type="email" id="femail" name="email" maxlength="50" required><br><br>
<label for="fsenha" id="stext">Senha</label>
<input type="password" id="fsenha" name="senha" maxlength="20" required><br><br>
<label for="frepita" id="rtext">Repita a senha</label>
<input type="password" id="frepita" name="repita" minlength="6" maxlength="20" required><br><br>
<input type="submit" id="fcadastrar" name="cadastrar" value="CADASTRAR">
</form>
</div>
<footer>
<h1>By Héctor França</h1>
</footer>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="cadastro.js"></script>
</html>