Advertisement
Guest User

Marika merda

a guest
Jan 23rd, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_GET['username']) AND isset($_GET['password'])){
  4. $username = $_GET['username'];
  5. $password = $_GET['password'];
  6. } else {
  7. $username = "";
  8. $password = "";
  9. }
  10.  
  11. if(isset($_COOKIE['username']) AND isset($_COOKIE['password'])){
  12. $username = $_COOKIE['username'];
  13. $password = $_COOKIE['password'];
  14. }
  15.  
  16. ?>
  17.  
  18. <?php
  19.  
  20. if($username == "test" AND $password == "test"){
  21.  
  22. echo '
  23. Loggato!
  24.  
  25. <br><br>
  26.  
  27. <form method="POST">
  28. <input type="submit" name="logout" value="logout"/>
  29. <a href="login.php"></a>
  30. </form>
  31. ';
  32.  
  33. if(isset($_POST['logout'])){
  34. $username = NULL;
  35. $password = NULL;
  36. header("refresh:0; url=login.php");
  37. }
  38.  
  39. setcookie("username", $username, time() + 300);
  40. setcookie("password", $password, time() + 300);
  41. } else {
  42. echo '
  43.  
  44. <form action="login.php" method="GET">
  45. Username:&nbsp;<input type="text" name="username"></input>
  46. <br><br>
  47. Password:&nbsp;<input type="password" name="password"></input>
  48. <br><br>
  49. <input type="submit" value="Login"></input>
  50. </form>
  51.  
  52. ';
  53. }
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement