Advertisement
Daniel3996

Password field is not showing up

Nov 19th, 2023 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head> <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.  
  7. <title>Form</title> </head> <body> <form method="post"> <label for="Name">Name</label> <input type="text" id="name" name="name"> <label for="Password">Password</label> <input type="password" name="password" id="password"> <input type="submit" name="submit" id="submit"> </form> </body> </html>
  8.  
  9. <?php
  10. if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['submit'])){ if(isset($_POST['name']) && isset($_POST['password'])){ $name = $_POST['name']; $password = $_POST['password']; require('../connect.php'); $query = "INSERT INTO cols (name,password) VALUES (?,?)";
  11. $stmt = mysqli_prepare($conn,$query);
  12.  
  13. mysqli_stmt_bind_param($stmt,"ss", $name, $password);
  14.  
  15. $result = mysqli_stmt_execute($stmt);
  16. if($result = true){
  17. echo "Sucess";
  18. }else{
  19. echo mysqli_error($conn);
  20. }
  21. mysqli_close($conn);
  22. }
  23. }
  24. ?>
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement