Sistemas WEB CREATE DATABASE banco; USE banco; CREATE TABLE usuario (Id INT(10) AUTO_INCREMENT PRIMARY KEY, nome VARCHAR(255), email VARCHAR(255), senha VARCHAR(12)) Sistemas WEB form.html <!DOCTYPE html> <html> <head> <title>Sistema WEB - UBC</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form action="cadastro.php" method="POST"> Nome......: <input type="text" name="nome" /><br /> Email......: <input type="text" name="email" /><br /> Password: <input type="text" name="senha" /><br /> <button type="submit">Enviar</button> <button type="reset">Limpar</button> </form> </body> </html> cadastro.php Sistemas WEB <?php $nome = $_POST['nome']; $email = $_POST['email']; $senha = $_POST['senha']; include "config.php"; $mysqli->query("INSERT into usuario(nome, email, senha) VALUES('$nome', '$email', '$senha')"); echo "<script>alert('Usuário incluido com sucesso!')</script>"; ?> config.php <?php $mysqli = new mysqli("localhost", "appweb", "PJTqbogYrNA8vVTU", "banco"); ?> Sistemas WEB deletar.html <!DOCTYPE html> <html> <head> <title>Exclusão de dados - UBC</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form action="deletar.php" method="POST"> Digite o codigo do usuario: <input type="text" name="id" size="1"/> <button type="submit">Excluir</button> </form> </body> </html> deletar.php <?php include 'config.php'; $id = $_POST['id']; Sistemas WEB $mysqli->query("DELETE FROM usuario WHERE id='$id'"); echo "<script>alert('Usuario excluido com sucesso!')</script>"; ?> alterar.html <!DOCTYPE html> <html> <head> <title>Sistema WEB - UBC</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form action="alterar.php" method="POST"> Digite o codigo do usuario: <input type="text" name="id" size="1"/><br/> Nome......: <input type="text" name="nome" /><br /> Email......: <input type="text" name="email" /><br /> Password: <input type="text" name="senha" /><br /> <button type="submit">Alterar</button> </form> </body> Sistemas WEB </html> alterar.php <?php $id = $_POST['id']; $nome = $_POST['nome']; $email = $_POST['email']; $senha = $_POST['senha']; include "config.php"; $mysqli->query("UPDATE usuario SET id='$id',nome=' $nome',email='$email',senha='$senha' WHERE id='$id'"); echo "<script>alert('Dados atualizados com sucesso!')</script>"; ?> form.html Sistemas WEB alterar.html deletar.html