Re: HTTP Authentication with PHP

From: Date: Thu, 01 Jun 2000 14:49:38 +0000
Subject: Re: HTTP Authentication with PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-804@lists.php.net to get a copy of this message
Hello, it's me again. When I use phpinfo() to display all related information, I get a field called Server API. It's set to CGI. Does this mean the server admin has it set to CGI and not a module ?? This could explain why my code doesn't work if i'm correct. It's PHP 4.0 by the way. Thanks Joey "Joey" <jduguay@nbnet.nb.ca> wrote in message news:8h5s93$3ct$1@cvs.php.net... > Hello, > > I hoping someone can help me out with this. Here is the web server > config. > > Sun Solaris > Netscape Web Server > PHP installed as module > > I'm getting the following error. > > trying to GET /joey/auth.php3, cgieng_scan_headers reports: the CGI program > /usr/local/bin/php > did not produce a valid header (name without value: got line "http/1.0 401 > unauthorized") > > Here is my code. > > <?php > // File Name: auth01.php > // Check to see if $PHP_AUTH_USER already contains info > > if (!isset($PHP_AUTH_USER)) { > > // If empty, send header causing dialog box to appear > Header("WWW-Authenticate: Basic realm=\"My Private Stuff\""); > Header("HTTP/1.0 401 Unauthorized"); > echo 'Authorization Required.'; > exit; > } > > // If not empty, display values for variables > else { > echo " > <P>You have entered this username: $PHP_AUTH_USER<br> > You have entered this password: $PHP_AUTH_PW<br> > The authorization type is: $PHP_AUTH_TYPE</p> > "; > } > ?> > > This is just a test to see how well it works but I can't get it to work. > According to all documentation this should work fine. I tried with IE and > Netscape ( different versions) and still nothing. I hope someone can shed > some light on this problem. > > Thanks > Joey ( Newbie) > > > > -- > 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 >

« previous php.general (#804) next »