Advertisement
Guest User

Untitled

a guest
Feb 7th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <!--loggin.php-->
  2. <?php
  3. error_reporting(-1); // Report all type of errors
  4. ini_set('display_errors', 1); // Display all errors
  5. ini_set('output_buffering', 0); // Do not buffer outputs, write directly
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <title>Loggin</title>
  11. </head>
  12. <body>
  13.  
  14. <?php
  15. include('databaseConnection.php');
  16.  
  17. if (isset($_POST['send']))
  18. {
  19. $username = $_POST["username"];
  20. $password = $_POST["password"];
  21.  
  22. $sql = "SELECT * FROM users WHERE userName = '$username' ";
  23. $stmt = $dbConn->prepare($sql);
  24.  
  25. $data = array();
  26. $stmt->execute($data);
  27. $res = $stmt->fetch(PDO::FETCH_ASSOC);
  28. $output = htmlentities(print_r($res, 1));
  29. echo "<pre>$output</pre>";
  30. }
  31. ?>
  32.  
  33. <form method ="POST" action ="">
  34. <input type="text" name="username">
  35. <input type="password" name="password">
  36. <input type="submit" name="send">
  37. </form>
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement