Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!Doctype html>
- <html lang="pt-br">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="Author" content="Hercio Neto">
- <title>Aula HTML - Formulários</title>
- <style type="text/css">
- body {
- font-family: Arial, sans-serif;
- font-size: 16px;
- background-color: #f0f0f0;
- }
- .container {
- max-width: 800px;
- margin: 0 auto;
- padding: 20px;
- background-color: #fff;
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
- }
- form label {
- display: block;
- margin-bottom: 5px;
- font-weight: bold;
- }
- form input[type="text"], form input[type="email"], form select {
- width: 98%;
- padding: 10px;
- border: 1px solid #ccc;
- border-radius: 4px;
- margin-bottom: 20px;
- }
- form input[type="submit"] {
- background-color: #ec2300;
- color: #fff;
- padding: 10px 20px;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- }
- form input[type="submit"]:hover {
- background-color: #aa2913;
- }
- @media screen and (max-width: 480px) {
- form input[type="text"], form input[type="email"], form select {
- width: 90%;
- }
- form input[type="submit"] {
- width: 90%;
- }
- }
- </style>
- </head>
- <body >
- <div class="container">
- <h1>Exclusão de Pessoa</h1>
- <?php
- if (!is_null($_GET['codigo'])) {
- $codigo = $_GET['codigo'];
- $conexao = new mysqli("localhost", "root", "", "uri_web");
- // Verificar se a conexão foi estabelecida corretamente
- if ($conexao->connect_error) {
- die("Erro na conexão: " . $conexao->connect_error);
- }
- $sql = "SELECT * FROM pessoas where codigo = $codigo";
- $resultado_pagina = $conexao->query($sql);
- if ($resultado_pagina->num_rows > 0) {
- while ($registro = $resultado_pagina->fetch_assoc()) {
- ?>
- <form method="POST" action="confirmaExclusaoDados.php">
- <label for="nome">Nome:</label>
- <input type="text" id="nome" name="nome" required value="<?php echo $registro["nome"]; ?>" disabled>
- <input type="hidden" name="codigo" value="<?php echo $registro["codigo"]; ?>">
- <label for="email">E-mail:</label>
- <input type="email" id="email" name="email" required value="<?php echo $registro["email"]; ?>" disabled>
- <input type="submit" value="Clique se deseja realmente excluir">
- </form>
- <?php } }
- } else { echo "<br>Selecione um registro."; }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement