Re: php-db Digest 24 Jul 2000 03:31:51 -0000 Issue 114
| From: | hvp3a at cs dot virginia dot edu | Date: | Mon, 24 Jul 2000 04:18:21 +0000 |
| Subject: | Re: php-db Digest 24 Jul 2000 03:31:51 -0000 Issue 114 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1428@lists.php.net to get a copy of this message | ||
Quoting php-db-digest-help@lists.php.net:
Try putting your authentication code *above* the <html>... stuff.
Chris
::tried that, doesn't work. error is same, with the same two lines. thanks.
> -----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/webman/servers/htdoc/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/webman/servers/htdoc/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