RE: [PHP-DB] PHP databse authentication problemo

From: Date: Sat, 22 Jul 2000 22:48:40 +0000
Subject: RE: [PHP-DB] PHP databse authentication problemo
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-1426@lists.php.net to get a copy of this message
Try putting your authentication code *above* the <html>... stuff. Chris > -----Original Message----- > From: hvp3a@cs.virginia.edu [mailto:hvp3a@cs.virginia.edu] > Sent: Saturday, July 22, 2000 6:43 PM > To: php-db@lists.php.net > Subject: [PHP-DB] PHP databse authentication problemo > > > hi people, i am having some problems with php. > i have created an encrypted password file (passwrd) on apache > server, and i > want php to access it each time @ log-in, authenticate user > password and > proceed to a new php page(- the standard procedure). > the script: > -------------------------------------------------------------- > ----------------- > <html><head></head><body> > <input type = "password" name = "pw" size = 10 maxlength = 10> > <input type = "submit" name = "pwsubmit" value = "please > enter"> > <?php > echo "Please enter your password here<br>"; > if(!isset($PHP_AUTH_USER)) { > Header("WWW-Authenticate: Basic realm= > \"hjk/webman/servers/apache_1.2.1/passwrd/\""); (LINE 14) > Header("HTTP/1.0 401 Unauthorized"); (LINE 15) > echo "please try again\n"; > exit; > } else { > echo "Hello $PHP_AUTH_USER.<P>"; > echo "You entered $PHP_AUTH_PW as your password.<P>"; > } > ?> > </body></html> > -------------------------------------------------------------- > ----------------- > OUTPUT:*** > Warning: Cannot add more header information - the header was > already sent > (header information may be added only before any output is > generated from the > script - check for text or whitespace outside PHP tags, or > calls to functions > that output text) in > /home/webmaster/server/htdocs/trialphp/1.php on line 14 > > Warning: Cannot add more header information - the header was > already sent > (header information may be added only before any output is > generated from the > script - check for text or whitespace outside PHP tags, or > calls to functions > that output text) in > /home/webmaster/server/htdocs/trialphp/1.php on line 15 > Please try again > ****** > however i DO NOT use mysql. i have also tried combinations > for encrypted > password file path name (LINE 14). doesn't help. i am new to > this, any > mantras... > thanks, > harsh (hvp3a@cs.virginia.edu) > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.db (#1426) next »