sending header
| From: | Robert Ludvik | Date: | Thu, 07 Dec 2000 14:23:26 +0000 |
| Subject: | sending header | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-29133@lists.php.net to get a copy of this message | ||
hi
i set up auth. on my page with $PHP_AUTH_USER and _PW. problem is that
if user type in ie. wrong passwd, program says that "he is not allowed
to see this page...blah blah". how do i implement another login
window. i tried to set it like function :
function auth() {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo ("...blah blah..\n");
exit;
}
and later
if ((!isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW)))
auth();
else {
...look in Postgres db to find a name and passwd,
if found ok,
else auth();
but this doesn't work.
it reports an error "Warning: Cannot add header information - headers
already sent by "
i get the problem - sending header twice - how can i solve this???
thnx robert