Guest User

Untitled

a guest
Jan 25th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4.  
  5. <head>
  6.  
  7. <title>BackForTeam | Perfil</title>
  8.  
  9. <meta charset="UTF-8">
  10.  
  11. <link rel="stylesheet" type="text/css" href="style3.css">
  12.  
  13. </head>
  14.  
  15. <body>
  16.  
  17. <div class="login-formulario">
  18.  
  19. <form method="POST" action="perfil-veri.php">
  20.  
  21. <input type="text" class="login" name="user_name" id="user_name" placeholder="Usuario">
  22.  
  23. <input type="password" class="senha" name="pwd" id="pwd" placeholder="Senha">
  24.  
  25. <input type="submit" class="submit" name="update" id="update" value="Entrar">
  26.  
  27. </div>
  28.  
  29.  
  30.  
  31. </body>
  32.  
  33. </html>
  34.  
  35. <?php
  36.  
  37. $servername = "localhost";
  38.  
  39. $username = "xxx";
  40.  
  41. $password = "xxxx";
  42.  
  43. $dbname = "xxx";
  44.  
  45.  
  46.  
  47. $id = $_POST['id']);
  48. $user_name = $_POST['user_name']);
  49.  
  50. // Create connection
  51.  
  52. $conn = new mysqli($servername, $username, $password, $dbname);
  53.  
  54. // Check connection
  55.  
  56. if ($conn->connect_error) {
  57.  
  58. die("Connection failed: " . $conn->connect_error);
  59.  
  60. }
  61.  
  62.  
  63. $sql = "UPDATE users SET user_name = '".$user_name."' WHERE id = '".$id."'";
  64.  
  65. if ($conn->query($sql) === TRUE) {
  66. echo "Atualizado com Sucesso";
  67. } else {
  68. echo "Erro na hora de atualizar: " . $conn->error;
  69. }
  70.  
  71. $conn->close();
  72. ?>
Add Comment
Please, Sign In to add comment