Hello,

 I just got two emails explaining my error.
Thanks to all.
I wasn't thinking right and sort of had my cart before my horse.
The fix is simple, put the header call before anything else.
I was thinking I had to get the input first  --  wrong.
 All I needed was to put this line first, at the very top of the script.
if ($dog == 'mal')
header ('Location: ../aamaillist/ml_menu.php');

thanks for all help

malcolm



On Sat, 15 Feb 2003 09:01:30 -0500, Malcolm <[EMAIL PROTECTED]> 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.

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 ?



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to