Re: Problem...header already sent by

From: Date: Tue, 05 Feb 2002 06:37:46 +0000
Subject: Re: Problem...header already sent by
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83541@lists.php.net to get a copy of this message
Okay, I deleted the other stuff and just put this code and I get this from my interpreter? Is this a setting problem? Thanks, Peter <?php Header ("WWW-authenticate: Basic realm=\"Private\""); Header ("HTTP/1.0 401 Unauthorized"); echo "Unauthorized"; exit; ?> [Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe "Martin Towell" <martin.towell@world.net> wrote in message news:6416776FCC55D511BC4E0090274EFEF5089E90@exchange.world.net... you have : 24. header("www-Authenticate: Basic realm='Private'"); 25. header("HTTP/1.0 401 Unauthrized"); I have (and this works) Header ("WWW-authenticate: Basic realm=\"$blah\""); Header ("HTTP/1.0 401 Unauthorized"); * "Unauthrized" should be "Unauthorized" - missing "o" -----Original Message----- From: Niklas Lampén [mailto:niklas.lists@publico.fi] Sent: Tuesday, February 05, 2002 4:51 PM To: Php-General Subject: RE: [PHP] Problem...header already sent by There can't be _anything_ before headers. Even a single space and/or linebreak causes an error. Niklas -----Original Message----- From: Peter Ruan [mailto:rpete@hotmail.com] Sent: 5. helmikuuta 2002 7:42 To: sheltren@cox.net; php-general@lists.php.net Subject: Re: [PHP] Problem...header already sent by I tried it w/o the <html> tag and I get the BAD Header message. -Peter >From: Jeff Sheltren <sheltren@cox.net> >To: "Peter Run" <rpete@hotmail.com>,php-general@lists.php.net >Subject: Re: [PHP] Problem...header already sent by >Date: Mon, 04 Feb 2002 21:30:42 -0800 > >You can't send anything before you send headers... the "html" tag is >messing you up I believe. > >Jeff > >At 08:24 PM 2/4/2002 -0800, Peter Run wrote: >>Hi, >> I get the warning message (see below), whenever I try anything with >>authentication/session with PHP. This is tried under Windows (PHPTriad). >>I >>get the same message with my Linux drive as well. I appreciate your help. >>Please reply here and cc: to my personal email rpete@hotmail.com >> >>Thanks in advance, >>-Peter >>************************** >>Warning: Cannot add header information - headers already sent by >>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in >>C:\apache\htdocs\proj\sports\phps\verify.php on line 26 >>*************************** >> >>1. <html> >>2. <?php >> .... >> >> >> 23. if (!$auth) { >> 24. header("www-Authenticate: Basic realm='Private'"); >> 25. header("HTTP/1.0 401 Unauthrized"); >>... >>?> >></html> >> >> >> >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php > > _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#83541) next »