-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcadastro_deficiencia.php
More file actions
48 lines (43 loc) · 1.63 KB
/
Copy pathcadastro_deficiencia.php
File metadata and controls
48 lines (43 loc) · 1.63 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
<?php
session_start();
include_once 'includes/functions.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$nome = $_POST['nome'];
$conn = db_connect();
$sql = "INSERT INTO deficiencias (nome) VALUES (?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $nome);
if ($stmt->execute()) {
echo "<div class='alert alert-success'>Deficiência cadastrada com sucesso!</div>";
} else {
echo "<div class='alert alert-danger'>Erro ao cadastrar deficiência.</div>";
}
}
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cadastro de Deficiência</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
<h2>Cadastro de Deficiência</h2>
<form method="POST" action="">
<div class="form-group">
<label for="nome">Nome:</label>
<input type="text" class="form-control" name="nome" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Cadastrar</button>
<a href="dashboard.php" class="btn btn-secondary ml-2">Voltar</a>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>