Hi... I have a problem with PHP Authenticate....
...if I enter user/pw wrong the first time it stops and I have to close/open
I've tried to unset $PHP_AUTH_USER but then it just loops...

if(!isset($PHP_AUTH_USER)) {
    Header("WWW-Authenticate: Basic realm=\".: Privat område :.\"");
    Header("HTTP/1.0 401 Unauthorized");
    echo "<br><font face=\"arial, helvetica, sans-serif\" size=\"2\"
color=\"#0060CF\">Secured Area!</font>";
  } else {
    $PHP_AUTH_PW_ENCRYPTED = crypt("$PHP_AUTH_PW", "wP");

    $connect = mysql_connect($hostname,$username,$password) or die ("Klarer
ikke koble til MqSQL db...");

    $query = "SELECT * FROM forfatter";
    $query .= " where id = $PHP_AUTH_USER";
    $result = mysql_db_query($db, $query);

    while($row = mysql_fetch_array($result)) {
 $id = $row["id"];
      $navn = $row["navn"];
      $pw = $row["pw"];

    if (($id == $PHP_AUTH_USER) AND ($pw == $PHP_AUTH_PW_ENCRYPTED))

      $bruker_ok = true;
    } else


Fredrik A. Takle

Fredrik A. Takle

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to