Re: Re: unset $PHP_AUTH_USER

From: Date: Wed, 07 Nov 2001 19:15:51 +0000
Subject: Re: Re: unset $PHP_AUTH_USER
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-73778@lists.php.net to get a copy of this message
Thanks, Galkov. But after logging in succesfully ( chage test_login() return to TRUE ), it won't ask me again for the password when I reload. Dt ----- Original Message ----- From: "Galkov Vladimir" <galkov@kraft-s.ru> To: <php-general@lists.php.net> Sent: Wednesday, November 07, 2001 1:59 PM Subject: [PHP] Re: unset $PHP_AUTH_USER > Good day.... some time agoo I try to unset this var to .. but without > adwance to victory... so if any body know how dynamickly change the vars > ($PHP_AUTH_USER, $PHP_AUTH_PW).. will be interesting to know... > But I thinck in you situation you may use this code: > > <? > if (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW)) > { > halt_access(); > } > else // login & pswd are present test them! > > > if (test_login($PHP_AUTH_USER, $PHP_AUTH_PW)) > { > echo "here procected.... ;-) zone..."; > echo '<hr>'; > } > else > halt_access(); > } > > function halt_access() > { > global $REALM; > > Header( "WWW-Authenticate: Basic realm=\"$REALM\""); > Header( "HTTP/1.0 401 Unauthorized"); > echo "Authorization Required\n"; > exit; > } > > function test_login($login, $pswd) > { > /* > now authorization functions are not present!... > may be MySQL qwery or somth special... > play whit true/false to understand how it drive.... > */ > > // return true; > return false; > } > > ?> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.general (#73778) next »