Advertisement
Guest User

php simple password cookie with get

a guest
Jul 20th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2. $password="123456";
  3. if (isset($_GET['password'])){
  4.     setcookie("password", $_GET['password']);
  5.     $_COOKIE['password']=$_GET['password'];
  6. }
  7. if (!isset($_COOKIE['password']) || $_COOKIE['password']!=$password) {
  8.     echo 'sorry, you are not allowed to view this...';
  9.     die;
  10. }
  11. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement