Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4.  
  5. $link = mysqli_connect ("localhost", "nome_usuario", "senha_usuario", "teste");
  6.  
  7. $UID = $_POST["UID”];
  8. $nome = $_POST["nome”];
  9. $endereco = $_POST["endereco”];
  10.  
  11. # prepara a string com a operacao de insercao (SQL)
  12. $query = "INSERT INTO usuario (uid,nome,endereco) VALUES ('$UID','$nome','$endereco')”;
  13.  
  14. # realiza a operacao
  15. $result = mysqli_query($link, $query);
  16.  
  17. echo $result;
  18. echo
  19.  
  20. # fecha a conexao com o mysql
  21. mysqli_close($link);
  22.  
  23. echo "Dados inseridos na base...”;
  24. ?>
  25. <form action=”index.html” method=”post”>
  26. <input type=”submit” />
  27. </form>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement