Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <meta charset="utf8_general_ci">
- <title> sistema de cadastro</title>
- <link rel="stylesheet" href="_css/estilo.css">
- </head>
- <body>
- <div class="container">
- <nav>
- <ul class="menu">
- <a href="index.php"<li>Cadastro</li></a>
- <a href="consultas.php" <li>Consultas</li></a>
- </ul>
- </nav>
- <section>
- <h1>Cadastro de Usuario</h1>
- <hr><br><br>
- <form method="post" action= "processa.php">
- <input type="submit" value="Salvar" class="btn">
- <input type="reset" value="Limpar" class="btn">
- <br><br>
- Nome <br>
- <input type="text" name= "nome" class= "campo" maxlength="40" required autofocus> <br>
- Email <br>
- <input type="email" name="Email" class="campo" maxlength="50" required><br>
- Profissao <br>
- <input type="text" name="Profissao" class="campo" maxlength="40" required><br>
- </form>
- </section>
- </div>
- </body>
- <html>
- <?php
- $hostname = "localhost";
- $user = "root";
- $password = "";
- $database = "cadastro4";
- $conexao = mysqli_connect($hostname, $user, $password, $database);
- if (! $conexao){
- echo "falha na conexao com o banco de dados";
- <?php
- include_once ("conexao.php");
- $nome =$_POST ('$nome');
- $email=$_POST ('Email');
- $profissao=$_POST ('Profissao');
- $sql = ("insert into usuarios3 (nome,email, profissao) values ('$nome', '$email', '$profissao')");
- $salvar = mysqli_query ($conexao, $sql);
- mysqli_close ($conexao);
- ?>
- $nome = $_POST['nome'];
- $email= $_POST['Email'];
- $profissao= $_POST['Profissao'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement