Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(isset($_SESSION['login'])){
  4. header("Location: Stranka.php");
  5. }
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta charset="UTF-8">
  11. <link rel="stylesheet" type="text/css" href="Loginstyle.css">
  12. <title>Administrace</title>
  13. </head>
  14. <body>
  15. <div id="Login">
  16. <div class="logintext">
  17.  
  18. <form method="POST">
  19. <label for="name"><font size="5.5" color="white"><b>Jméno: </b></font></label>
  20. <input type="text" name="name" placeholder="username">
  21. <br>
  22. <label for="pass"><font size="5.5" color="white"><b>Heslo:&nbsp;&nbsp;</b></font></label>
  23. <input type="password" name="pass" placeholder="password">
  24.  
  25. <input type="submit" name="check" value="Přihlásit se">
  26.  
  27. </form>
  28.  
  29. </div>
  30. </div>
  31. <?php
  32. $password = 'mysqlerror404';
  33. $username1 = 'root';
  34. $usernamefake = 'admin';
  35. $passwordfake = 'admin1234';
  36.  
  37.  
  38.  
  39. if (isset($_POST['check'])) {
  40. $username = htmlspecialchars($_POST['name']);
  41.  
  42.  
  43. if ($_POST['name'] == $username1 && $_POST['pass'] == $password) {
  44. $_SESSION['login'] = "root";
  45. header("Location: Stranka.php");
  46. die();
  47. } else if ($_POST['name'] == $usernamefake && $_POST['pass'] == $passwordfake) {
  48. $_SESSION['login'] = "admin";
  49. header("Location: http://google.com");
  50. die();
  51. } else {
  52. echo "<b><center><font color='white'>Chybné uživatelské jméno nebo heslo !</font></center></b>";
  53. }
  54. }
  55. ?>
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement