Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Http authentication code by w3tools.info
- $user = "myuser"; //username here
- $pass = "mypass"; //password here
- if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER']!=$user || $_SERVER['PHP_AUTH_PW']!=$pass){
- header('WWW-Authenticate: Basic realm="Enter password to access this page."');
- header('HTTP/1.0 401 Unauthorized');
- echo"You must be logged in";
- exit;
- }
- # Your protected contents go here !!
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement