Advertisement
Mindsmog

Untitled

Jan 19th, 2020
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Document</title>
  8. </head>
  9. <body>
  10. <?php
  11.  
  12. $mypassword = $_POST['psw'];
  13. $myusername = $_POST['uname'];
  14.  
  15. // prisijungimas
  16. $conn = new mysqli($servername, $username, $password, $dbname);
  17.  
  18. $sql = "SELECT adminusername FROM adminsecret WHERE id = 1";
  19. $adminusername = $conn->query($sql);
  20. $sql = "SELECT adminpassword FROM adminsecret WHERE id = 1";
  21. $adminpassword = $conn->query($sql);
  22.  
  23.  
  24. if($adminusername == $myusername && $adminpassword == $mypassword){
  25.     header("Location: main.php", true);
  26. }else{
  27.     echo("wrong $adminpassword $adminusername");
  28. }
  29. $conn->close();
  30. ?>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement