Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="pt-br">
  3. <head>
  4. <meta charset="utf8_general_ci">
  5. <title> sistema de cadastro</title>
  6. <link rel="stylesheet" href="_css/estilo.css">
  7. </head>
  8. <body>
  9. <div class="container">
  10. <nav>
  11. <ul class="menu">
  12. <a href="index.php"<li>Cadastro</li></a>
  13.  
  14. <a href="consultas.php" <li>Consultas</li></a>
  15. </ul>
  16.  
  17. </nav>
  18. <section>
  19. <h1>Cadastro de Usuario</h1>
  20. <hr><br><br>
  21. <form method="post" action= "processa.php">
  22. <input type="submit" value="Salvar" class="btn">
  23. <input type="reset" value="Limpar" class="btn">
  24. <br><br>
  25.  
  26. Nome <br>
  27. <input type="text" name= "nome" class= "campo" maxlength="40" required autofocus> <br>
  28. Email <br>
  29. <input type="email" name="Email" class="campo" maxlength="50" required><br>
  30. Profissao <br>
  31. <input type="text" name="Profissao" class="campo" maxlength="40" required><br>
  32.  
  33. </form>
  34.  
  35.  
  36. </section>
  37. </div>
  38. </body>
  39. <html>
  40.  
  41. <?php
  42.  
  43. $hostname = "localhost";
  44. $user = "root";
  45. $password = "";
  46. $database = "cadastro4";
  47. $conexao = mysqli_connect($hostname, $user, $password, $database);
  48. if (! $conexao){
  49. echo "falha na conexao com o banco de dados";
  50.  
  51. <?php
  52.  
  53. include_once ("conexao.php");
  54. $nome =$_POST ('$nome');
  55. $email=$_POST ('Email');
  56. $profissao=$_POST ('Profissao');
  57.  
  58. $sql = ("insert into usuarios3 (nome,email, profissao) values ('$nome', '$email', '$profissao')");
  59.  
  60. $salvar = mysqli_query ($conexao, $sql);
  61.  
  62.  
  63. mysqli_close ($conexao);
  64.  
  65. ?>
  66.  
  67. $nome = $_POST['nome'];
  68. $email= $_POST['Email'];
  69. $profissao= $_POST['Profissao'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement