Re: PHP4 & AUTH procedure

From: Date: Sat, 24 Mar 2001 22:37:16 +0000
Subject: Re: PHP4 & AUTH procedure
References: 1  Groups: php.lang 
Request: Send a blank email to php-lang+get-129@lists.php.net to get a copy of this message
It has something to do with register_globals. Try to turn it on in your php.ini. I tried it myself and found out that this piece of code works: <?php if(!isset($HTTP_SERVER_VARS['PHP_AUTH_USER'])) { Header("WWW-authenticate: Basic realm=\"Acceso restringido\""); Header("HTTP/1.1 401 Unauthorized"); echo "To access you need a pair (name,password), SORRY!!"; exit; } else { echo "ALL OK"; exit; } ?> When you don't have access to the configuration of php (for example hosted by a web provider) you can use this. Hope this was helpfull -- alex@alex-connect.com +49 9721 188848 +49 171 370 97 15

« previous php.lang (#129) next »