Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. $conn = mysqli_connect('localhost', 'root', '', 'classTest');
  3.  
  4. if(isset($_POST['submit'])){
  5. echo "Form was submitted" . '<br>';
  6.  
  7. $username = $_POST['username'];
  8. $password = $_POST['password'];
  9.  
  10. $username = mysqli_real_escape_string($conn, $username);
  11. $password = mysqli_real_escape_string($conn, $password);
  12.  
  13. echo "Username: " . $username . '<br>';
  14. echo "Password: " . $password . '<br>';
  15. }
  16. ?>
  17.  
  18. <!DOCTYPE html>
  19. <html>
  20. <head>
  21. <meta charset="utf-8">
  22. <title>Test</title>
  23. </head>
  24. <body>
  25.  
  26. <form action="test.php" method="post">
  27. <input type="text" name="username">
  28. <input type="password" name="password">
  29. <input type="submit" name="submit" value="submit">
  30. </form>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement