Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <style>
  2. body{
  3. background-color: #fa6cff;
  4. }
  5. </style>
  6. <?php
  7. //On request compare usernames and passwords in database to username and password variables'
  8. if(ISSET($_POST['LOGIN'])){
  9. if(!empty($_POST['uname']))[{
  10. if(!empty($_POST['password']))[{
  11. $username = $_POST['uname'];
  12. $password = $_POST['password'];
  13. $query = 'SELECT * FROM `user`';
  14. $conn = mysqli_connect('localhost', 'root', '', 'mygame') or DIE('BAD CONNECTION, TRY AGAIN');
  15. $result = mysqli_query($conn, $query) or DIE('BAD QUERY, TRY AGAIN');
  16. $msg = NULL;
  17. while($row = mysqli_fetch_array($result)){
  18. $username_db = $row['uname'];
  19. $password_db = $row ['password']
  20. $email_db = $row['email'];
  21. $id = $row['user_id'];
  22. $full_name_db = $row['fname'];
  23. }
  24. }
  25. }
  26. }
  27. ?>
  28. <html>
  29. <body>
  30. <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  31. <h2> Login </h2>
  32. <p> Username : </p> <input type = 'text' name = 'uname'> <br>
  33. <p> Password </p> <input type = 'password' name = 'password'> <br> <br>
  34. <input type = 'submit' name ='LOGIN' value = 'Login'>
  35. </form>
  36. </body>
  37. </html>
  38. <?php
  39. if (ISSET($_POST['Login'])){
  40. echo $msg;
  41. }
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement