Guest User

Untitled

a guest
Oct 18th, 2014
221
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. @$db = mysqli_connect("localhost", "", "", "");
  4.  
  5. if (mysqli_connect_errno()) {
  6. printf("Verbindung fehlgeschlagen: %s\n", mysqli_connect_error());
  7. exit();
  8. }
  9. $query = mysqli_query(db, 'SELECT * FROM login WHERE username = $_POST["username"]');
  10. $result = mysqli_fetch_assoc($query);
  11.  
  12.  
  13. if (!is_null($result) && md5($_POST["passwort"] === $result['passwort']))
  14. {
  15. echo "Login erfolgreich";
  16. }
  17. else
  18. {
  19. echo "Ung├╝ltiger Benutzername und/oder Passwort";
  20. }
  21. mysqli_free_result($result);
  22.  
  23. mysqli_close($db);
  24.  
  25. ?>
RAW Paste Data