Re: phpmyadmin

From: Date: Mon, 22 Oct 2001 02:52:50 +0000
Subject: Re: phpmyadmin
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-9947@lists.php.net to get a copy of this message
At 10:59 PM, 10/21/2001, you wrote:
i've got a copy of phpmyAdmin on my local and it's raw. is there a copy out there that have a user login or some security access before going inside the main database? thanks.
try editing the index to use this: <?
    // checks if you have entered a username and a password
    if (!$PHP_AUTH_USER || !$PHP_AUTH_PW)
    {
        // if empty, send header causing dialog box to appear
        header('WWW-Authenticate: Basic realm="PHPMyAdmin Realm"');
        header('HTTP/1.0 401 Unauthorized');
        echo "Authorization Required.";
        exit;
    }
    else
    {
        // check if the username and password are correct
        if (($PHP_AUTH_USER == "sigferd") && ($PHP_AUTH_PW == "doodlepip"))
        {
            // dispay happy message and admin stuff
            echo "w00t!";
        }
        else
        {
            // display angry message for invalid user
            echo "go away!";
        }
    }
?> *or*, try setting up an .htpasswd to require anything under /phpmyadmin (or whatever folder it is....) to require a password to GET or POST <-- I'm sure someone else on this list could explain that one though regards, -andrew saturn

« previous php.windows (#9947) next »