Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. <?php
  2. $_SESSION[''] = '';
  3. require("../css/mysql.php");
  4. ?>
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  6. <html>
  7. <head>
  8. <title>LogIn zum Adminbereich</title>
  9. <link rel="SHORTCUT ICON" href="gfx/favicon.ico">
  10. <link rel="stylesheet" type="text/css" href="/css/formatierung.css">
  11.  
  12. </head>
  13. <body>
  14. <?php if(!isset($_POST['submit'])) { ?>
  15. <form action="<?php $PHP_SELF ?>" method="post">
  16. <table width="200" height="*" cellspacing="2" cellpadding="2" border="1" bordercolor="#ffffff">
  17. <tr>
  18. <th width="*" class="th" colspan="5">
  19. <b>Log In</b>
  20. </th>
  21. </tr>
  22. <tr>
  23. <td width="*" bgcolor="#e7e7e7">Benutzer</td>
  24. <td width="*" bgcolor="#ffffff">
  25. <input type="text" name="username" size="20" class="input"></td>
  26. </td>
  27. </tr>
  28. <tr>
  29. <td width="*" bgcolor="#e7e7e7">Passwort</td>
  30. <td width="*" bgcolor="#ffffff">
  31. <input type="password" name="password" size="20" class="input"></td>
  32. </tr>
  33. <tr>
  34. <td bgcolor="#e7e7e7" align="center" colspan="2">
  35. <input type="submit" name="submit" value="Anmelden" class="button">
  36. </td>
  37. </tr>
  38. </table>
  39. </form>
  40. <?php
  41. }elseif(!$_POST['username'] || $_POST['username'] == "") {
  42. echo '<p align="center">Einen Benutzernamen brauchen wir schon ;-)<br /><br />
  43. <a href="index.php">Zurück</a></p>';
  44. }elseif(!$_POST['password'] || $_POST['password2'] == "") {
  45. echo '<form action="index.php" method="post">';
  46. echo '<p align="center">Ein Passwort brauchen wir schon ;-)<br /><br />';
  47. echo '<input type="hidden" name="username" value="'.$_POST['username'].'">';
  48. echo '<input type="submit" name="zurueck" value="Zurück">';
  49. echo '</p>';
  50. echo '</form>';
  51. }else{
  52. $password = md5($_POST['password']);
  53. $query = @mysql_query("SELECT user, pass FROM users WHERE user = '".mysql_real_escape_string($_POST['username'])."'");
  54. $result = @mysql_fetch_array($query) or die('<p align="center">
  55. Sorry, aber dieser Benutzername existiert nicht!<br /><a
  56. href="index.php">Zurück</a></p>');
  57. if($password != $result['pass']){
  58. echo '<form action="index.php" method="post">';
  59. echo '<p align="center">Sorry, aber dieses Passwort ist falsch!<br /><br />';
  60. echo '<input type="hidden" name="username" value="'.$_POST['username'].'">';
  61. echo '<input type="submit" name="zurueck" value="Zurück"></p>';
  62. echo '</form>';
  63. die;
  64. }else{
  65. $user = $result['user'];
  66. session_register('user');
  67. echo '<p align="center">LogIn erfolgreich! :-)<br><br><a href="/in/index1.php" target="_top">Weiter</a></p>';
  68. }
  69. }
  70. ?>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement