Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['pass1'])){
  3. if($_POST['pass1']=="ZSE"){
  4. setcookie('token1',1,time()+30);
  5. header("Location: secret.php");
  6. }
  7. }
  8. ?>
  9. <!doctype html>
  10. <html lang="pl">
  11. <head>
  12. <meta charset="utf-8">
  13. <title>Tajne</title>
  14. </head>
  15. <body>
  16. <?php
  17. if(isset($_COOKIE['token1'])){
  18. if($_COOKIE['token1']==1){
  19. echo "<h1>Tajna treść</h1><p>Fraszka niepytka: Żyrafy wchodzą do szafy</p>";
  20. }
  21. else{
  22. echo "Błędny token";
  23. }
  24. }
  25. else{
  26. ?>
  27. <form action="" method="POST">
  28. <input type="password" name="pass1" placeholder="hasło"> <input type="submit">
  29. </form>
  30. <?php
  31. }
  32. ?>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement