Guest User

Untitled

a guest
Oct 20th, 2014
216
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. @$db = mysqli_connect("localhost", "weng", "", "");
  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. if (!is_null($result) && md5($_POST['passwort']) === $result['passwort'])
  13.  
  14.  
  15.  
  16.  
  17. echo "Login erfolgreich";
  18.  
  19. else
  20. echo "Ungültiger Benutzername und/oder Passwort";
  21.  
  22. mysqli_free_result($result);
  23.  
  24. mysqli_close($db);
  25.  
  26. ?>
RAW Paste Data