Page is a not externally linkable
naiquevin - 3:51 am on May 29, 2009 (gmt 0)
<?php // Username and Password for authorization $username = 'somename'; if(!isset($_SERVER['PHP_AUTH_USER']) ¦¦ !isset($_SERVER['PHP_AUTH_PW']) ¦¦ ($_SERVER['PHP_AUTH_USER'] != $username) ¦¦ ($_SERVER['PHP_AUTH_PW'] != $password)) { header('HTTP/1.1 401 Unauthorized'); } ?>
Ok ... I am using this code for authentication
$password = 'somepassword';
// The username and password are incorrect and so send the authentication headers
header('WWW-Authenticate:Basic realm ="My website"');
exit('<div align="center"><h2> My website </h2> You must enter valid username and password to access this page.');