I have a file called index.php4 that includes header.php4 , this is the file header.php4 :
<?
include "include/config.inc";
include "include/todo_functions.inc";
if (!@mysql_connect("$DB_SERVER","$DB_USER","$DB_PASS"))
{
echo mysql_errno().": ".mysql_error()."<BR>";
die("<BR><B>ERROR: Unable to connect to DB-Server $DB_SERVER</B>");
}
if (!@mysql_select_db("$DB_INSTANCE"))
{
echo mysql_errno().": ".mysql_error()."<BR>";
die("<BR><B>ERROR: Unable to select database $DB_INSTANCE</B>");
}
// Is this really a valid user?
if(!isset($PHP_AUTH_USER)) {
authenticate();
} else {
$username=strtolower($PHP_AUTH_USER);
$result = makeQuery("select * from todo_users where login_name='$username' and password='$PHP_AUTH_PW'");
if(!mysql_num_rows($result)) {
authenticate();
}
}
****** NEVER GET HERE **********************
?>
<head><title><?echo $title?></title>
<link rel=stylesheet type="text/css" href="include/todo.css">
<?
if (! $DEBUG) {
if ($page == "todo-delete" || $page == "todo-add" || $page == "todo-actions") {
print "<META HTTP-EQUIV=\"refresh\" content=\"1; URL=index.php3\">";
}
.......
......more code....
The authenticate() function come from todo_functions.inc file :
function authenticate() {
Header("WWW-authenticate: basic realm=\"ToDo-Liste\"");
Header("status: 401 Unauthorized");
?>
<HEAD>
<TITLE>ToDo-List.php</TITLE>
</HEAD>
<BODY>
<H1><CENTER>ToDo-List.php</CENTER></H1>
In order to proceed you will need a valid username/password!
<?
include "include/footer.inc";
exit;
}
I don't know why after three times prompting me to enter username and password I only get :
In order to proceed you will need a valid username/password!
thanks.