SHARE
TWEET

Untitled

a guest Oct 4th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. if (isset($_REQUEST["username"]) && isset($_REQUEST["password"]))
  4. {
  5.     $uname = $_REQUEST["username"];
  6.     $pword = $_REQUEST["password"];
  7.  
  8.     if($uname == "admin" && $pword == "justinRules")
  9.     {
  10.         setcookie("admin",TRUE);
  11.     }
  12.     else
  13.     {
  14.         setcookie("admin",FALSE);
  15.     }
  16. }
  17.  
  18. ?>
  19.  
  20. <html>
  21. <body>
  22.  
  23. <?php
  24.  
  25. if($_COOKIE["admin"] == TRUE)
  26. {
  27.     echo "Admin Control Panel";
  28. }
  29. else
  30. {
  31.     echo "Welcome normal user";
  32. }
  33.  
  34. ?>
  35.  
  36. <form action="home.php" method="post">
  37. Username: <input type="text" name="username" />
  38. Password: <input type="text" name="password" />
  39. <input type="submit" />
  40. </form>
  41.  
  42. </body>
  43. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top