Re: another easy cookie question

From: Date: Fri, 14 Sep 2001 11:19:36 +0000
Subject: Re: another easy cookie question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67364@lists.php.net to get a copy of this message
If nothing but the header Location ran then it would send him to his page, but its not even doing that. It's giving him an error before it does that. He already mentioned he didn't have any html or anything before the headers. ----- Original Message ----- From: "Niklas Lampén" <niklas.lampen@publico.fi> To: "Php-General" <php-general@lists.php.net> Sent: Friday, September 14, 2001 3:51 AM Subject: RE: [PHP] another easy cookie question > First of all, before header() or setcookie() can't be any outputing code > (like html). > > And here if you do: > > <?php > header("Location: index.php"); > setcookie(blah); > .... > > Nothing else but header() will be run, since it will move you to the > index.php file. > > > P.S. Notice the space: header("Location: index.php"); > > > Niklas > > > -----Original Message----- > From: George Pitcher [mailto:fmdev@yahoo.co.uk] > Sent: 14. syyskuuta 2001 12:47 > To: php-general@lists.php.net > Subject: [PHP] another easy cookie question > > > Hi all, > > This is what I have at the top of my php page (php-4.0.6-winNT). > > <html> > <head> > <?php > header("Location:index.php"); > setcookie("Cookievalue", "abcdefghijklmnopqrstuvwxyz0123456789") > time()+3600); > ?> > <title>Untitled Document</title> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > </head> > > I get the following error. > > CGI Error > The specified CGI application misbehaved by not returning a complete set of > HTTP headers. The headers it did return are: > > ... and nothing else! > > Where am I going wrong? I bet it's a simple answer. > > George P in Edinburgh > > > > > _________________________________________________________ Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > -- > 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 > > > -- > 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 (#67364) next »