Headers bust ?

From: Date: Sat, 15 Feb 2003 14:01:30 +0000
Subject: Headers bust ?
Groups: php.general 
Request: Send a blank email to php-general+get-135661@lists.php.net to get a copy of this message
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. The error messages; (output started at c:\foxy\www\project_db\switchtest.php:2) in c:\foxy\www\project_db\switchtest.php on line 11 The script; <? echo "<h4> This script uses a predefined list of names to <i>switch</i></h4>"; echo" Input mal, jim or joe <br> <form> Your Name: <input type = text name = dog> <input type=submit name=blah value=Check Me Out !> </form>"; switch ($dog) { case mal: header("location =../aamaillist/ml_menu.php");
       break;
case jim:
	    echo "<body bgcolor=navy text=White>";
       print "<Hi Jim<br>
If you were jim you could have a private page here."; echo "</body>";
       break;
case joe: echo "<body bgcolor=gray text=#F8E714 >"; print "Hello Joe<br>"; echo "</body>";
       break;
default:
       print "You must be a stranger.<br>";
} ?> How can I redirect without output before the header ?

« previous php.general (#135661) next »