george-goga

auth.php

Dec 9th, 2021
700
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. $one;
  3.  $two;
  4.  $three;
  5. function auth()
  6. {
  7. if(!empty($_POST["go"])!=null)
  8. {
  9. if(!empty($_POST["login"]) &&!empty( $_POST["password"]))
  10. {
  11.     $_SESSION["pass"]=$_POST["password"];
  12.     $_SESSION["log"]=$_POST["login"];
  13.  
  14.     }
  15.     }
  16. }
  17.  
  18. function outer()
  19. {
  20.     if($_POST["out"])
  21.     {
  22.         session_unset();
  23.        
  24.         }
  25. }
  26.  
  27. function entrance()
  28. {
  29.  if(empty($_SESSION["pass"] )&& empty($_SESSION["log"]))
  30.  {
  31. echo
  32. "<form action=\"index.php\" method=\"post\">
  33. <input type=\"text\" name=\"login\">
  34. <input type=\"text\" name=\"password\">
  35. <input type=\"submit\" name=\"go\" value=\"go\">
  36. </form>";
  37. auth();
  38.     }
  39.  elseif(!empty($_SESSION["pass"] )&& !empty($_SESSION["log"]))
  40.  {
  41. echo
  42.  "<form action=\"index.php\" method=\"post\">
  43. <input type=\"submit\" name=\"out\" value=\"out\">
  44. </form>";
  45. echo $_SESSION["log"];
  46. outer();
  47.  }
  48. }
  49. ?>
RAW Paste Data