|
Posted by Jerry Stuckle on 07/13/05 20:04
maxx wrote:
> Hi,
>
> I want use the header authentification (HTTP/PHP module), and i've a
> big problem for to get the varaibles 'PHP_AUTH-*".
>
> This is my source code :
> ---------------------------------------------------------------------------------
> <?php
> function authentificate() {
> header('WWW-Authenticate: Basic realm="My Realm"');
> header('HTTP/1.0 401 Unauthorized');
> echo 'Texte utilisé si le visiteur utilise le bouton
> d\'annulation';
> exit;
> }
>
> include("ffrs_mysql-2.inc.php");
> $sql = new MyDB();
>
> $userauth =
> $sql->getAuthUser($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
>
> if ($userauth == ($_SERVER['PHP_AUTH_USER'])) ##
> Don't work
> (or if ("maxx" == ($_SERVER['PHP_AUTH_USER'])) ##
> Work)
> {
> echo "c bon";
> include("adduserAdminForm.php");
> print_r ($_SERVER);
> }
> else
> {
> authentificate();
> }
> ?>
> ---------------------------------------------------------------------------------
>
>
> The window popup authentification don't open and i am going directly on
> my page. When i replace "$userauth" by "maxx" for example, the window
> popup authentification open with no problem and i can login myself.
>
Way too little information for anyone to help you. For instance - what is
"MyDB"? What is the function call "getAuthUser"? What is the function call
"authentificate"?
None of these are standard PHP calls. If they come from a package you're using,
I suggest you follow up with whomever supports that package. Otherwise, we need
to know a lot more about what's happening.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|