Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. $verbindung = mysql_connect("localhost", "root" ,"")
  4. or die("keine verbindung m&ouml;glich.Falsches Passwort oder falscher Benutzername");
  5.  
  6. mysql_select_db("test3")
  7. or die ("keine Datenbank mit diesem Namen gefunden");
  8.  
  9.  
  10. $abfrage = mysql_query(" SELECT * FROM `user` WHERE `userid` = 1");
  11. echo mysql_num_rows($xy);
  12. ?>
  13.  
  14.  
  15.  
  16. <form method="POST" action="">
  17.  
  18. Username: <input type="text" name="username">
  19. Passwort: <input type="text" name="password">
  20. <input type="submit" name="submit" value="login">
  21.  
  22.  
  23. </form>
  24.  
  25. <?php
  26.  
  27. $xy = mysql_query("SELECT * FROM user WHERE username =  '".$_POST['username']."' AND password = '".md5($_POST['password'])."'");
  28.  
  29.  
  30. if (!empty($_POST['username']) && isset($_POST['username'])  )
  31. if (!empty($_POST['password']) && isset($_POST['password'])  )
  32.  
  33. if (mysql_num_rows ($xy) == 1)
  34.     {
  35.         $user = mysql_fetch_object($xy);
  36.         echo 'Willkommen'.$user->username;
  37.     }
  38.  
  39.         else echo 'pw falsch';
  40.  
  41.  
  42.  
  43. echo "ÄÜ";
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. mysql_close($verbindung);
  51.  
  52.  
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement