I found this script:
----------------
<?php
header(' Basic realm="My Private Stuff"');
header('Status: 401 Unauthorized');
// File Name: auth02.php
// Check to see if $PHP_AUTH_USER already contains info
if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
echo 'Authorization Required.';
exit;
} else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != "admin" || ($PHP_AUTH_PW != "letmein") {
echo 'Authorization Required.';
exit;
} else {
echo "
<P>You're authorized!</p>
";
}
}
?>
------------
The problem with this script is that the loginbox comes up, but I have to fill in the login-info 3 times because the popup returns twice after the first login.
I'd like the popup just once, and then the page i try to secure...
Anyone any ideas?
----------------
<?php
header(' Basic realm="My Private Stuff"');
header('Status: 401 Unauthorized');
// File Name: auth02.php
// Check to see if $PHP_AUTH_USER already contains info
if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
echo 'Authorization Required.';
exit;
} else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != "admin" || ($PHP_AUTH_PW != "letmein") {
echo 'Authorization Required.';
exit;
} else {
echo "
<P>You're authorized!</p>
";
}
}
?>
------------
The problem with this script is that the loginbox comes up, but I have to fill in the login-info 3 times because the popup returns twice after the first login.
I'd like the popup just once, and then the page i try to secure...
Anyone any ideas?