Advertisement
Guest User

Untitled

a guest
Jan 28th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1.  <?php
  2. session_start()  ;
  3. include ("config.php");
  4. include ("database.php");
  5. ?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  10. <title><?php $title ?></title>
  11. </head>
  12. <body>
  13.  
  14. <form action="login.php" method="post">
  15. <p>Benutzername:<br/>
  16. <input name="username" type="text" maxlength="20"></p>
  17.  
  18.  
  19. <p>Passwort:<br/>
  20. <input name="passwort" type="password"></p>
  21.  
  22. <input name="submit" type="submit" value="Registrieren"></p>
  23.  
  24. </form>
  25.  
  26. </body>
  27. </html>
  28.  
  29.  
  30. <?php
  31.  
  32.  
  33. if(isset($_POST['submit']))
  34.  
  35. {
  36.  
  37. if(empty($_POST['username']) or empty($_POST['passwort']) )
  38. {
  39.     echo '<script type="text/javascript">;alert("Bitte alle Felder ausfüllen!")</script>';
  40. }
  41.  
  42. else
  43.  
  44. {
  45.  
  46. $username = $_POST['username'];
  47. $passwort = $_POST['passwort'];
  48.  
  49.  
  50. $mysqlgetuser = mysql_query("SELECT username, passwort FROM users WHERE username LIKE '$username' LIMIT 1") or
  51. die(mysql_error());
  52.  
  53. $mysqlgetuserrow = mysql_fetch_object($mysqlgetuser) ;
  54.  
  55. if($mysqlgetuserrow->passwort == $passwort)
  56.  
  57. {
  58.     echo ('Erfolgreich eingeloggt '. $username . '<meta http-equiv="refresh" content="2;url='. $pfad .'index.php">');
  59.     $_SESSION['username'] = $username;
  60.  
  61. }
  62.  
  63. else
  64.  
  65. {
  66.     echo ("Falsche eingabe! <br /> Haben Sie Ihr <a href=" .$pfad ."passwortvergessen.php>Passwort vergessen?</a>");
  67.  
  68. }
  69. }
  70. }
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement