Hi,
I found this script on the net and find it pretty easy and usefull. But I have a fe questions though....
Is there a way that when you have access to the page you can add
a user? Maybe by calling the username and password from a
seperate file? I don't need this top-secure but is it a
bit secure?
Thanks in advancePHP Code:<?php
$LOGIN = "Username";
$PASSWORD = "Password";
function error ($error_message) {
echo $error_message."<BR>";
print "Access denied";
exit;
}
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $LOGIN) && ( $PHP_AUTH_PW == "$PASSWORD" )) ) {
header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
header("HTTP/1.0 401 Unauthorized");
error("<BR>");
}
?>
<HTML><HEAD><TITLE>protected page</TITLE></HEAD>
<BODY BGCOLOR="#F2F1EE">
My page
</BODY>
</HTML>
:)
