Advertisement
Guest User

Untitled

a guest
Nov 7th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?
  2. $username= "admin";
  3. $password= jakieshaslo;
  4.  
  5. if (!$PHP_AUTH_USER) {
  6.                 header("WWW-Authenticate: Basic realm=\"test\"");
  7.                 header("blad.html");
  8.                 exit;
  9.         }
  10.         else {
  11.                 if ($PHP_AUTH_USER != $username || $PHP_AUTH_PW != $password) {
  12.                 echo "papa";
  13.                 exit;
  14.                 }
  15. }
  16.         $cookie_name = "auth";
  17.         $cookie_value = "ok";
  18.         $cookie_expire = "0";
  19.         $cookie_domain = "";
  20.  
  21.         setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);                                                                
  22.  
  23. header( "Location: strona.html");
  24.         exit;
  25. ?>
  26.  
  27.  
  28. \\Plik html \/
  29. <?if ($auth != "ok") {
  30.         header( "Location: http://kallosz.clik.pl");
  31.         exit;
  32. }?>
  33. <head>
  34. </head>
  35.  
  36.  
  37. <p aling="center">Jestes na stronie testowej. jesli widzisz ten komunikat to zostales zalogowany poprawnie :)</p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement