Re: Headers bust ?

From: Date: Sat, 15 Feb 2003 14:04:34 +0000
Subject: Re: Headers bust ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-135664@lists.php.net to get a copy of this message
On Sat, 2003-02-15 at 09:01, Malcolm wrote: > Hello, > > I've been fooling with this for a few days now. > I'm getting a hearders already sent error. > I know it means I've got output before the header but > I can't figure how else to do this. Hi Malcom-- Looks like you are outputting data right after your script starts (on line to, you have an echo right away). You should either (a) turn on output buffering, which should take care of the problem, or (b) (the best solution because it makes your script behave the way it should) move things around so that the decision on the redirect is made before outputting anything. Try adding this at the beginning, before the echo: if ($dog == 'mal') header ('Location: ../aamaillist/ml_menu.php'); Hope this helps! Marco -- ---------------- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com!

« previous php.general (#135664) next »