authentication help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aquilo at hotmail.com

    authentication help

    I am using this standard code at the start of my script to request a
    user to login. After the user enters information the login box just pops
    back up. The script does not move to the else portion after a login is
    entered. It just stays in the first part of the if statement. Any help?
    if (!isset($PHP_AU TH_USER))
    {
    header('WWW-Authenticate: Basic realm = "Club"');
    header('HTTP/1.0 401 Unauthorized');
    echo "Nice try, if you really are supposed to be in here, try again.\n";
    exit;
    }
    else
    {
    $linkID = @mysql_connect( "localhost" , "username", "password") ;
    etc....
    }

  • Matthew Vickers

    #2
    Re: authentication help

    On Tue, 02 Sep 2003 23:17:58 -0700
    "aquilo at hotmail.com" <"aquilo at hotmail.com"> wrote:
    [color=blue]
    > I am using this standard code at the start of my script to request a
    > user to login. After the user enters information the login box just
    > pops back up. The script does not move to the else portion after a
    > login is entered. It just stays in the first part of the if statement.
    > Any help?
    > if (!isset($PHP_AU TH_USER))
    > {
    > header('WWW-Authenticate: Basic realm = "Club"');
    > header('HTTP/1.0 401 Unauthorized');
    > echo "Nice try, if you really are supposed to be in here, try
    > again.\n"; exit;
    > }
    > else
    > {
    > $linkID = @mysql_connect( "localhost" , "username", "password") ;
    > etc....
    > }
    >[/color]

    Prehaps you should try

    if (!isset($_SERVE R['PHP_AUTH_USER']))

    Your php.ini file may have register_global s set to off. A good thing
    BTW.


    Matt

    --
    Quispiam Power Computing | "There are two major products that come out
    Pendle Hill, Australia | of Berkeley: LSD and UNIX. We don't believe
    +61 2 9631 7719 | this to be a coincidence. "
    www.quispiam.com | - Jeremy S. Anderson

    Comment

    Working...