require ("auth.php");
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"User Login\"");
Header( "HTTP/1.0 401 Unauthorized");
echo "You failed to provide the correct password....\n";
exit;
}
else {
$con = mysql_pconnect ("$host", "$user", "$pass") or die("Error: " . mysql_error());
mysql_select_db ("$db");
$user_id = strtolower($PHP_AUTH_USER);
$result = mysql_query("SELECT password FROM signup " . "Where username = '$user_id'");
$row = mysql_fetch_array($result);
if ($PHP_AUTH_PW != $row["password"]) {
Header( "WWW-Authenticate: Basic realm=\"Login failed please try again!\"");
Header( "HTTP/1.0 401 Unauthorized");
echo "You failed to provide the correct password....\n";
exit;
}
}
?>