Re: sending header

From: Date: Fri, 08 Dec 2000 02:29:24 +0000
Subject: Re: sending header
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29136@lists.php.net to get a copy of this message
Make sure that no other header, echo or print's come before the header call you did. Jay ----- Original Message ----- From: "Robert Ludvik" <robert.ludvik@zd-lj.si> To: <php-general@lists.php.net> Sent: Thursday, December 07, 2000 9:23 AM Subject: [PHP] sending header > 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 > > > -- > 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 (#29136) next »