Advertisement
Guest User

Untitled

a guest
Apr 5th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. Uzytkownik zalogowany!<br>
  6. <center>
  7. <fieldset>
  8. <table>
  9. <form action="xd">
  10. Technik:
  11. <select name="Technik">
  12. <option></option>
  13. <option> Technik Informatyk</option>
  14. <option>Fototechnik</option>
  15. <option>Teleinformatyk</option>
  16. </select>
  17. </form>
  18. <br>
  19. <form action="xd">
  20. Czas:
  21. <select name="Czas">
  22. <option></option>
  23. <option>Uslugi na rok</option>
  24. <option>Uslugi na 2lata</option>
  25.  
  26. </select>
  27. </form>
  28. <br>
  29. <form action="xd">
  30. Zlecenia:
  31.  
  32. <select name="Zlecenie">
  33. <option></option>
  34. <option>Pakiet Podstawowy</option>
  35. <option>Pakiet Sredni</option>
  36. <option>Pakiet Premium</option>
  37. </select>
  38. </form>
  39. </table>
  40. Uwagi:<br>
  41. <textarea name="nazwa" cols="10" rows="5">Brak uwag</textarea><br>
  42. <button type="rodzaj">Wyslij</button>
  43.  
  44.  
  45.  
  46. </fieldset>
  47. </body>
  48. </html>
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. <?php
  56. session_start();
  57.  
  58. $userinfo = array(
  59. 'user1'=>'password1',
  60. 'user2'=>'password2',
  61. 'user3'=>'password3',
  62. );
  63.  
  64. if(isset($_GET['logout'])) {
  65. $_SESSION['username'] = '';
  66. header('Location: ' . $_SERVER['PHP_SELF']);
  67.  
  68.  
  69. }
  70.  
  71. if(isset($_POST['username'])) {
  72. if($userinfo[$_POST['username']] == $_POST['password']) {
  73. $_SESSION['username'] = $_POST['username'];
  74. header('Location:stronka.html ');
  75. }else {
  76. echo "<p>error logging in</p>";
  77. }
  78. }
  79. ?>
  80.  
  81. <head>
  82. <title>Login</title>
  83. </head>
  84. <body>
  85. <?php if($_SESSION['username']): ?>
  86. <p>You are logged in as <?=$_SESSION['username']?></p>
  87. <p><a href="?logout=1">Logout</a></p>
  88. <?php endif; ?>
  89. <form name="login" action="" method="post">
  90. Username: <input type="text" name="username" value="" /><br />
  91. Password: <input type="password" name="password" value="" /><br />
  92. <input type="submit" name="submit" value="Submit" />
  93. </form>
  94. </body>
  95. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement