Re: HTTP authentication with PHP

From: Date: Sun, 02 Jul 2000 03:17:48 +0000
Subject: Re: HTTP authentication with PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4333@lists.php.net to get a copy of this message
Hi Linda, Try deleting line 1, the empty line. Matt Linda Lin wrote: > > Hi, > > I am a beginner on PHP. I tried the following code, > expecting a small pop-up window allowing me to enter > the user name and password. But nothing showed up, > except a message of "Text to send if user hits Cancel > button". Could anyone give me some suggestiones on how > to fix it? > > Thanks a lot, > > Linda > > 1 > 2 <?php > 3 if(!isset($PHP_AUTH_USER)) { > 4 Header("WWW-Authenticate: Basic realm=\"My > Realm\""); > 5 Header("HTTP/1.0 401 Unauthorized"); > 6 echo "Text to send if user hits Cancel > button\n"; > 7 exit; > 8 } else { > 9 echo "Hello $PHP_AUTH_USER.<P>"; > 10 echo "You entered $PHP_AUTH_PW as your > password.<P>"; > 11 } > 12 ?> > 13 > > __________________________________________________ > Do You Yahoo!? > Kick off your party with Yahoo! Invites. > http://invites.yahoo.com/ > > -- > 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 -- Matt Allen Linux/PHP eCommerce Solutions Linux Worx Linux Networking www.linuxworx.com.au Consulting matt@linuxworx.com.au 0413 777 771

« previous php.general (#4333) next »