Advertisement
Guest User

dla Mateuszka

a guest
Apr 12th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?PHP
  2. session_start();
  3. if(iSset($_SESSION['zalogowany'])){
  4. header("location:glowna.php");
  5. echo "test";
  6. }
  7. ?>
  8. <html>
  9. <head>
  10. <title>Sesja</title>
  11. <meta charset="utf-8">
  12. <style>
  13. div.container{
  14. height: 10em;
  15. position: relative;
  16. }
  17. div.container p{
  18. font-size: 30px;
  19. margin: 0;
  20. position: absolute;
  21. top: 80%;
  22. left: 50%;
  23. margin-right: -50%;
  24. transform: translate(-50%, -50%);
  25. text-align: center;
  26. }
  27. input.button{
  28. width: 70px;
  29. height: 30px;
  30. font-size: 16px;
  31. }
  32. </style>
  33.  
  34. </head>
  35. <body>
  36. <form action="" method="post">
  37. <div class="container">
  38. <p>
  39. WITAJ NA STRONIE GLOWNEJ <br>
  40. Login: <input type="text" name="loginuser"/> <br>
  41. Password: <input type="text" name="passworduser"/> <br><br>
  42. <input class="button" type="submit" name="button"/>
  43. </p>
  44. </div>
  45. </form>
  46. <?PHP
  47. if(isset($_POST['button'])){
  48. $login = "student";
  49. $password = "student";
  50. $loginuser = $_POST['loginuser'];
  51. $passworduser = $_POST['passworduser'];
  52. if($loginuser == $login && $passworduser == $password){
  53. header("location:glowna.php");
  54. }
  55. echo "$login";
  56. echo "$password";
  57. }
  58. ?>
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement