Guest User

Untitled

a guest
Oct 18th, 2014
262
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. echo "Ung├╝ltiger Benutzername und/oder Passwort";
  19.  
  20. mysqli_free_result($result);
  21.  
  22. mysqli_close($db);
  23.  
  24. ?>
RAW Paste Data