Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?><!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <?php
- if (isset($_GET['logout']) && $_GET['logout']==1)
- {
- unset($_SESSION['czy_zalogow']);
- session_destroy();
- }
- if(isset($_POST['login']) && isset($_POST['haslo']))
- {
- $l = $_POST['login'];
- $h = $_POST['haslo'];
- if($l == "admin" && $h == "tajne")
- {
- $_SESSION['czy_zalogow']=1;
- }
- }
- if(!isset($_SESSION['czy_zalogow']))
- {
- ?>
- <form name="f1" method="post" action="wyloguj.php">
- Login: <input type="text" name="login"><br>
- Hasło: <input type="password" name="haslo"><br>
- <input type="submit" value="Zaloguj">
- <?php
- }
- else
- {
- echo "<a href=\"wyloguj.php?logout=1\">Wyloguj!</a>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement