Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. if (empty($this->input->server('PHP_AUTH_USER')))
  2. {
  3. header('HTTP/1.0 401 Unauthorized');
  4. header('HTTP/1.1 401 Unauthorized');
  5. header('WWW-Authenticate: Basic realm="My Realm"');
  6. echo 'You must login to use this service'; // User sees this if hit cancel
  7. die();
  8. }
  9.  
  10. $username = $this->input->server('PHP_AUTH_USER');
  11. $password = $this->input->server('PHP_AUTH_PW');
  12.  
  13. // Check username and password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement