Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>BackForTeam | Perfil</title>
- <meta charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="style3.css">
- </head>
- <body>
- <div class="login-formulario">
- <form method="POST" action="perfil-veri.php">
- <input type="text" class="login" name="user_name" id="user_name" placeholder="Usuario">
- <input type="password" class="senha" name="pwd" id="pwd" placeholder="Senha">
- <input type="submit" class="submit" name="update" id="update" value="Entrar">
- </div>
- </body>
- </html>
- <?php
- $servername = "localhost";
- $username = "xxx";
- $password = "xxxx";
- $dbname = "xxx";
- $id = $_POST['id']);
- $user_name = $_POST['user_name']);
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "UPDATE users SET user_name = '".$user_name."' WHERE id = '".$id."'";
- if ($conn->query($sql) === TRUE) {
- echo "Atualizado com Sucesso";
- } else {
- echo "Erro na hora de atualizar: " . $conn->error;
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment